Chris == Chris Devers [EMAIL PROTECTED] writes:
Chris On Thu, 31 Mar 2005, Ankur Gupta wrote:
No I do not [want to] die so fast.. I want to do some processing based
on the died message.
Chris Fine then.
Chris eval {
Chris risky_action();
Chris }
You forgot a semicolon here,
On Thu, 31 Mar 2005, Randal L. Schwartz wrote:
Chris == Chris Devers [EMAIL PROTECTED] writes:
Chris Fine then.
Chris eval {
Chris risky_action();
Chris }
You forgot a semicolon here, which will make Perl start to think you
mean this to be an if modifier instead of
Hi,
I have the following code :
eval{
require file or die unable to find file;
};
print $@;
But it always prints Can't locate file in @INC. blah blah
I want $@ to contain unable to find file. What am I doing wrong or it is
not possible to override
On 03/30/2005 01:48 PM, Ankur Gupta wrote:
eval{
require file or die unable to find file;
};
print $@;
But it always prints Can't locate file in @INC. blah blah
If you actually want to die, try moving the die outside of the eval:
eval { require file;} or die
No I do not wanna die so fast.. I want to do some processing based on the
died message.
--
Ankur
-Original Message-
From: Todd de Gruyl [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 31, 2005 12:24 AM
To: Ankur Gupta
Cc: beginners@perl.org
Subject: Re: My own die message
On 03/30/2005
On Thu, 31 Mar 2005, Ankur Gupta wrote:
No I do not [want to] die so fast.. I want to do some processing based
on the died message.
Fine then.
eval {
risky_action();
}
if $@ {
my $status = $@;
my $result = do_some_processing();
die Got $status,
On Thu, 31 Mar 2005 00:18:14 +0530, Ankur Gupta wrote:
Hi,
I have the following code :
eval{
require file or die unable to find file;
};
print $@;
But it always prints Can't locate file in @INC. blah blah
I want $@ to contain unable to find file.
-Original Message-
From: Offer Kaye [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 31, 2005 2:21 AM
To: Ankur Gupta; Perl Beginners
Subject: Re: My own die message
On Thu, 31 Mar 2005 00:18:14 +0530, Ankur Gupta wrote:
Hi,
I have the following code :
eval
On 30/03/2005, Ankur Gupta wrote:
I have the following code :
eval{
require file or die unable to find file;
};
print $@;
But it always prints Can't locate file in @INC. blah blah
I want $@ to contain unable to find file. What am I doing wrong or
it is not possible to override