Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: (Perl 5.10.1 or before)What does $_ refer to here?

by ForgotPasswordAgain (Priest)
on Jun 13, 2019 at 13:41 UTC ( [id://11101312]=note: print w/replies, xml ) Need Help??


in reply to (Perl 5.10.1 or before)What does $_ refer to here?

Unsolicited advice, but since you're "strictifying" the script, I'd recommend changing open IN, $filename to open my $in, '<', $filename (and if you don't use autodie, then also add or die("Couldn't open $filename: $!")). A global FILEHANDLE led to one of the nastiest bugs I've ever debugged. Also the code assumes $1, $2, and $3 were matched, so you might want to add a check on whether they're defined.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found