Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Where does <GEN1> come from?

by liverpole (Monsignor)
on May 24, 2007 at 18:28 UTC ( [id://617308]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://617308]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 17:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found