Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: syntax questions

by AnomalousMonk (Monsignor)
on Mar 07, 2013 at 03:28 UTC ( #1022139=note: print w/ replies, xml ) Need Help??


in reply to Re: syntax questions
in thread syntax questions

open my $filelist, '>', $filelist or die "Can't open $filelist: $!";

This is simply an inadvertance, but using a new lexical  my $filelist for the filehandle in the open statement masks the file name in the old lexical of the same name (and also generates a warning if warnings are enabled, which is strongly recommended). I would write something like:

>perl -wMstrict -le "my $filelist = 'xyzzy'; open my $filehandle, '>', $filelist or die qq{opening '$filelist': $! +}; print $filehandle $_ for qw(foo bar baz); close $filehandle or die qq{closing '$filelist': $!}; " >type xyzzy foo bar baz


Comment on Re^2: syntax questions
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (17)
As of 2014-07-31 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls