Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: output to STDOUT or a file

by bv (Friar)
on Sep 04, 2009 at 18:12 UTC ( #793536=note: print w/ replies, xml ) Need Help??


in reply to output to STDOUT or a file

I'm confused about this line:

if (shift)

What are you shifting off? Or is it just a general "put a condition here" line? Also, how does this benefit over:

my $fh; if(my $filename = shift) { open $fh, '>', $filename or die "Can't open $filename: $!"; } else { open $fh, '>&', STDOUT; } print $fh "Where do you want to go today?\n";
print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))


Comment on Re: output to STDOUT or a file
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-07-14 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (254 votes), past polls