Help for this page

Select Code to Download


  1. or download this
    eval {
    system("perl 2.pl");
    ...
     print "the error that was thrown in 2.pl";
    }
    ...
    
  2. or download this
    system("blah") or die "Can't blah $!\n";
    
  3. or download this
    my $ret_val = system("perl 2.pl");
    if ( $ret_val == 0 ) {
    ...
    else {
        printf "Error. Err Number: %d", $ret_val<<8;
    }
    
  4. or download this
    exit 0        if $success;
    exit $err_num if $err_num;  # numerical error value
    exit -1;                    # WTF???
    
  5. or download this
    open F, $file or do {
        warn "Can't open $file for read $!\n";
    ...
    do_stuff(*F);
    close F;
    exit 0;