Rhandom has asked for the wisdom of the Perl Monks concerning the following question:
use Data::Dumper qw(Dumper); $SIG{__WARN__} = sub { &handle_it(@_); warn @_ }; $SIG{__DIE__} = sub { &handle_it(@_); die @_ }; sub handle_it { print Dumper \@_; }
die "foo"; # prints as "foo at script line whatever\n" - stringifie +d #die "foo", "foo"; # stringified - same as above but with "foofoo" #die {hi => 'there'}; # not stringified - shows correctly as a hashre +f #die 'foo',{hi => 'there'}; # stringified "fooHASH{whatever}" #warn {hi => 'there'}; # always stringified
die "Something happend", {extra_argument_to_show_pretty_error => 1};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Argument stringification in __WARN__ and __DIE__
by broquaint (Abbot) on May 14, 2003 at 21:24 UTC | |
by Rhandom (Curate) on May 14, 2003 at 22:06 UTC | |
by broquaint (Abbot) on May 15, 2003 at 10:01 UTC | |
|
Re: Argument stringification in __WARN__ and __DIE__ (p5p)
by tye (Sage) on May 14, 2003 at 20:23 UTC |