Changeset 233

Show
Ignore:
Timestamp:
11/10/06 00:38:50 (7 years ago)
Author:
max
Message:

Undo changeset [231], apparently my_die() is needed in dog after all.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • engines/dog

    r232 r233  
    2929# Changelog: 
    3030# 0.3.1  : split 'dog' into its own engine 
     31 
     32BEGIN { *CORE::GLOBAL::die = \&my_die; } 
    3133 
    3234use strict; 
     
    15841586} 
    15851587 
     1588# ----------------------------------------- 
     1589# Subs: override handlers for standard perl. 
     1590# ----------------------------------------- 
     1591 
     1592# ugly hack. please don't try this at home kids! 
     1593sub my_die { 
     1594    my ($arg,@rest) = @_; 
     1595    my ($pack,$file,$line,$sub) = caller(0); 
     1596 
     1597    # check if we are in an eval() 
     1598    if ($^S) { 
     1599        printf "  shepherd caught a die() within eval{} from file $file line $line\n"; 
     1600    } else { 
     1601            printf "\nDIE: line %d in file %s\n",$line,$file; 
     1602            if ($arg) { 
     1603                CORE::die($arg,@rest); 
     1604            } else { 
     1605                CORE::die(join("",@rest)); 
     1606            } 
     1607    } 
     1608} 
     1609