in reply to Re: Tiptoe through the punctuation
in thread Tiptoe through the punctuation
Well done!
$. is also known as $INPUT_LINE_NUMBER and is to be considered read-only. It is undefined until you read from a filehandle or it is assigned to by your program. If you assign a value to $. and then read from a filehandle, it will be reset to its proper value by Perl.
Example:
#!/usr/bin/perl -w use strict; print "\$. is ", $., $/; $. = 9999; print "\$. is now ", $., $/; print "Press <enter> to continue.\n"; my $input = <>; print "\$. is now ", $., $/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $. explained
by tye (Sage) on Mar 11, 2003 at 18:15 UTC |