Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
We don't bite newbies here... much
 
PerlMonks  

Re: Re: (jeffa) Re: getting output from backticks

by Wookie (Beadle)
on Jul 19, 2001 at 09:49 UTC ( [id://98019]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: (jeffa) Re: getting output from backticks
in thread getting output from backticks

Well the 256 result code should track back to a more specific error - if you check out the documentation for mount - you may find out more precisely what that error means.

As for system Vs. backticks etc. - when I have to use one or the other - I generally try this sub:
# SubRoutine: sysrun # # Run System Command sub sysrun { my ($command) =@_; my $ret_code; $ret_code = system("$command"); if ( $ret_code == 0 ) { # Job suceeded $ret_code = 1; } else { # Job Failed $ret_code = 0; } return ($ret_code); }
While this doesn't store the return code from the system call, it does allow you to treat the system call with logical operators like any other perl program

Also, the return_code can easily be logged if there is an error from this sub.
game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://98019]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.