Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Backticks and exit status

by space_monk (Chaplain)
on Oct 31, 2012 at 14:25 UTC ( [id://1001671]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/bin/perl
    # first command deliberately generates an error....
    ...
    print "ls Output:\n";
    print `ls -l`;
    print "ls Result: $?\n";
    
  2. or download this
    Rubbish Result: -1
    ls Output:
    ...
    -rwxr-xr-x 1 Userid Domain Users  351 Oct 30 10:48 test.pl
    -rwxr-xr-x 1 Userid Domain Users  108 Oct 31 14:21 var.pl
    ls Result: 0
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-19 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found