Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Not entirely true. For many programs if you get back $? of 256 (which is what a return code of 1 looks like), that is not necessarily an errror.

Here is why. The return codes in the standard C libraries are an error code. 0 means, appropriately enough, no error. After that it is up to the author's imagination. In complex applications this generally means a standardized list of messages (kind of like the list enshrined in $!). In smaller applications people often use the convention that 1 is a minor issue that is not really an error and 2 is a fatal error.

For instance try this:

perl -e 'print system("ls no_such_file")'
That gives back 256. It doesn't list anything, but none of its operations ran into trouble, and you might not have expected the file to be there. Now try that with a directory that you don't have permission to access. You will get back a more serious error - it cannot give you a real answer because you are not permitted to know that.

In reply to Re (tilly) 2: Eval and system() by tilly
in thread Eval and system() by camelman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2022-08-13 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?