Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: echo $? in perl

by roboticus (Chancellor)
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 perusing the Monastery: (12)
As of 2015-07-06 11:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (73 votes), past polls