Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

You haven't said which O/S you are running on and that might well have an impact here.

elseif ($signal_num != 0)

That isn't Perl, so either the code you are showing isn't the code you are running or your code isn't running at all.

The upper 8 bits had an exit code of 139, which indicates a seg fault, but the signal for seg fault was not set.

An exit code of 139 does not necessarily indicate a seg fault. Trivially:

#!/usr/bin/env perl use strict; use warnings; system ('perl -e "exit 139"'); my $exit_value = $? >> 8; my $signal_num = $? & 127; my $dumped_core = $? & 128; print <<EOT Exit value: $exit_value Signal: $signal_num Core: $dumped_core EOT
Is there a module or library I can use to automatically catch all of the "bad" return values so I don't have to code all of the enumerations of signals and return values myself?

Unlikely because your idea of "bad" may not be someone else's idea of "bad". However, you could simply write your own module for your own use and then use that in all your other code.


🦛


In reply to Re: Help checking program return values by hippo
in thread Help checking program return values by Special_K

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 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?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-26 04:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found