Problems with exceptions and packages

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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
James Smith [ So, 13 Januar 2008 12:35 ] [ ID #1906897 ]

Re: Problems with exceptions and packages

> 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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
ken1 [ So, 13 Januar 2008 14:04 ] [ ID #1906898 ]
Perl » gmane.comp.lang.perl.active-perl » Problems with exceptions and packages

Vorheriges Thema: I'm new.
Nächstes Thema: Regarding using MLDBM with Storable