in reply to Where does <GEN1> come from?

Hi mnooning,

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.

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^2: Where does <GEN1> come from?
by mnooning (Beadle) on May 25, 2007 at 23:37 UTC
    Now that is what I call an esoteric nuance!

    Thank you all very much for the comments and the code.

    And yes, it is Net::Daemon code I am looking at.

    Thanks