esharris has asked for the wisdom of the Perl Monks concerning the following question:
The following program illustrates the difference.
On my machine, it returns ...#!/usr/bin/perl -w use Carp; eval { eval { die "Pig\n"; }; if ($@) { print $@."\n"; die $@; } }; print $@ if $@; eval { eval { croak "Pig\n"; }; if ($@) { print $@."\n"; croak $@; } }; print $@ if $@;
Pig Pig Pig eval {...} called at ./test7.pl line 13 eval {...} called at ./test7.pl line 12 Pig eval {...} called at ./test7.pl line 13 eval {...} called at ./test7.pl line 12 eval {...} called at ./test7.pl line 12
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: croak not like die.
by brian_d_foy (Abbot) on Mar 16, 2005 at 19:11 UTC | |
|
Re: croak not like die.
by RazorbladeBidet (Friar) on Mar 16, 2005 at 18:57 UTC | |
by holli (Abbot) on Mar 16, 2005 at 19:14 UTC | |
by Joost (Canon) on Mar 16, 2005 at 22:53 UTC |