Problems with exceptions and packages

Problems with exceptions and packages

am 13.01.2008 12:35:48 von James Smith

Hey,

I have the following script (obviously much abridged):

+++

use strict;

use Error qw(:try);

#package jms;

{
try
{
throw Error();
}
catch Error with
{
my $e = shift;

print "Error: Caught Exception occurred...".$e."\n";
};

}

+++

The 'Error' exception is caught until I uncomment the package
declaration, can anyone tell me why?

Kind regards,

James

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Problems with exceptions and packages

am 13.01.2008 14:04:49 von ken1

> The 'Error' exception is caught until I uncomment the package
> declaration, can anyone tell me why?
>
Switch the order:

package jms;

use Error qw(:try);

HTH,

ken1

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs