Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Capture response from backticks to a file.

by dsb (Chaplain)
on Nov 13, 2013 at 19:26 UTC ( #1062437=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $gpg_command = `gpg --trust-model always -er 12345678 my_file.txt`;
    
    print defined($gpg_command) ? $gpg_command : "Command failed\n"
    
  2. or download this
    use strict;
    use FileHandle;
    ...
    my $fh = FileHandle->new('capture.out',"w");
    
    print $fh `dir`;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2020-11-25 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?