Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: echo $? in perl

by roboticus (Canon)
on Nov 30, 2007 at 20:59 UTC ( #654214=note: print w/ replies, xml ) Need Help??


in reply to echo $? in perl

bala_999:

As you were told repeatedly in the CB yesterday, your problem is that you insist on persist in using:

eval { $mov=$ssh->exec("echo $?\n","2"); }; warn $@ if $@;
instead of:
eval { $mov=$ssh->exec('echo $?\n',"2"); }; warn $@ if $@;
In the first, perl is evaluating the $? for you, so the remote machine sees something utterly different. It's seeing 'echo 0\n' instead of 'echo $?\n'. So of course you're always going to get a zero result...

...roboticus

Update: Upon rereading, the tone was harsher than intended.


Comment on Re: echo $? in perl
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (14)
As of 2014-09-01 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (300 votes), past polls