Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Perl System('') question

by spmlingam (Scribe)
on Nov 29, 2008 at 04:42 UTC ( [id://726728]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl System('') question
in thread Perl System('') question

Hi, i would like give some more information on this, if the output is more then one line, then use array to get the output.
my @output = qx(/usr/bin/eject -n);

If you want to use system function then you can redirect your output to a file and read the file content. it might useful, when you running a program as a daemon.
The backtick and qx are same, you can use the following option to check your code.
perl -MO=Deparse <scriptname>.

Replies are listed 'Best First'.
Re^3: Perl System('') question
by parv (Parson) on Nov 29, 2008 at 05:57 UTC
    What would be the purpose of B::Deparse output? Just use the -c option to check syntax: perl -c file.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-24 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found