Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Capture response from backticks to a file.

by dsb (Chaplain)
on Nov 13, 2013 at 19:26 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1062437]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-16 21:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found