Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: save output of program in another file

by pvaldes (Chaplain)
on Jun 06, 2013 at 20:54 UTC ( #1037512=note: print w/ replies, xml ) Need Help??


in reply to save output of program in another file

print to outfile.txt:

open $MYFILE, '>', "outfile.txt"; print $MYFILE "blah blah blah"; ### don't put "," after $MYFILE close $MYFILE;

what do i do in the command line?

i.e. in bash, you make a pipe with ">"

perl thisismygreatperlscript.pl > everythingwasfine-im-the-output.txt 2>somethingwaswrong-im-the-log.log

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2016-07-26 15:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (236 votes). Check out past polls.