> there are at least a couple of ways of doing that:
> 
> #!/usr/bin/perl -w
> use strict;
> 
> BEGIN{
>         use subs qw(Carp::die);
>         use vars qw($e);
>         sub Carp::die{ $e = "Carp::die: @_" }
> }
> 
> use Carp;
> 
> croak "croaking";
> 
> print "after croak \$e is: $e";
> 
> __END__
> 
> prints:
> 
> after croak $e is: Carp::die: croaking at x.pl line 10
> 
> another way to accomplish the same thing:
> 
> #!/usr/bin/perl -w
> use strict;
> 
> BEGIN{
> 
>         our $e;
> 
>         *CORE::GLOBAL::die = sub{
>                 $e = "CORE:GLOBAL::die => @_";
>         };
> }
> 
> use Carp;
> 
> use vars qw($e);
> 
> croak "croaking";
> 
> print "after croak \$e is: $e";
> 
> __END__
> 
> prints:
> 
> after croak $e is: CORE:GLOBAL::die => croaking at x.pl line 10
> 
> i don't have time to check out the source of Carp.pm but if
> you do, i would 
> suggest you go take a look as there might be a better 
> solution to it. out 
> of the 2 methods i described, the second one is more natural, imo.

Thanks that helped out abunch I believe it has me up and running!
I use the Carp::die so I won't effect any real die()s just the croak()s

Thanks again!

Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to