eval and exception

R. J. pisium at yahoo.com
Tue May 1 07:41:19 CDT 2001


Howdy,

I have a question regarding capturing exception in
eval. I could not use eval to catch the exception. 
For instance, I wrote a simple program in prac.pl as
($a, $b) = (10, 0);
print $a / $b;
Then in main.pl, I wrote
eval {
  system("perl -w main.pl");
};
if ($@) {
  print "error";
}
It just didn't print out "error" as I expected, which
means it didn't send any fatal string parameter to $@,
then I added
or die after system command, it's still the same. Is
it because I am using system command, so the process
is different. 

Now that I just call a perl program in the eval, what
if I run a c program or others with system command,
will eval be able to catch the exception?

Thanks

Rick



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
=================================================
Mailing list info:  If at any time you wish to (un|re)subscribe to
the list send the request to majordomo at hfb.pm.org.  All requests
should be in the body, and look like such
                  subscribe anchorage-pm-list
                  unsubscribe anchorage-pm-list



More information about the Anchorage-pm mailing list