Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • At first glance, it looks like you're trying merge lines from a file with filenames passed on the command line. Why? Heck if I know. If your line appears after a file has been read, $. will be >= 1, so $ARGV[0] might be the name of the file containing lines you're reading (since that name wouldn't print).

    open(IN, $ARGV[0]) or die "$ARGV[0]: $!";
    while ( <IN> ) {
        print "$ARGV[$.] $_\n";
    }

    What I'm pondering while looking at this, and without virtue of perlvar, is whether there's some other way that $. is side-effected.