in reply to Where does <GEN1> come from?
As BrowserUK says, it's the line number of the most recently opened filehandle.
Here's a (slightly contrived) example:
#!/usr/bin/perl use strict; use warnings; use FileHandle; my $iam = $0; my $fh = new FileHandle; open($fh, "<", $iam) or die "Can't open myself: '$iam' ($!)\n"; my $cnt = 15; while (my $line = <$fh>) { chomp $line; printf "%2d: %s\n", (10 / $cnt--), $line; }
When saved as the file "mytest", and run, it errors out on the 15th line, where a division by zero error occurs:
Illegal division by zero at mytest line 15, <GEN0> line 16.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Where does <GEN1> come from?
by mnooning (Beadle) on May 25, 2007 at 23:37 UTC |