Prev: FAQ 4.10 Why aren't my random numbers random?
Next: Why $NR and $INPUT_LINE_NUMBER are not the same as $.?
From: sln on 25 May 2010 17:05 On Mon, 24 May 2010 03:17:36 -0400, "Uri Guttman" <uri(a)StemSystems.com> wrote: >>>>>> "s" == sachin <reachsachin(a)gmail.com> writes: > > s> On May 23, 1:36�am, Ben Morrow <b...(a)morrow.me.uk> wrote: > >> Quoth Peng Yu <pengyu...(a)gmail.com>: > >> > >> > I know $NR is the same as $INPUT_LINE_NUMBER. But I'm wondering what N > >> > and R in NR stand for. > >> > >> > I think R might stand for numbeR? Does N stand for iNput or liNe? > >> > >> I presume you are using the English module? I would recommend against > >> it. Quite apart from the minor performance penalty (which can be avoided > >> with newer versions of English) the puncuation names are much more > >> familiar to most Perl programmers. > >> > >> Ben > > s> I believe if the record separator is '\n', and which is by default, > s> then NR would be same as number of lines. However, if we set the > s> record separator or delimiter as some other character, then value of > s> NR might be different. > > s> Please correct me if I am wrong. > >the name is Number of Records. a line is only a record if \n is the >value of $/. But a record is not dependent upon a newline, therefore the value of $/ is just a line separator in the menutia of file i/o and nothing else. -sln
First
|
Prev
|
Pages: 1 2 Prev: FAQ 4.10 Why aren't my random numbers random? Next: Why $NR and $INPUT_LINE_NUMBER are not the same as $.? |