At 13:13 Uhr +0900 17.01.2003, Nobumi Iyanaga wrote:
Hello Chris,

On Thursday, January 16, 2003, at 09:37 AM, Chris Nandor wrote:

 The Image::Size module on the CPAN should help you.

Thank you for your reply. Yes, it worked -- although I had to tweak somehow the source: replace the end of lines with cr, comment out the lines "use AutoLaoder" and "__END__".

Now, I would like to ask you how I can trap error when I invoke a module, but that module is not installed on the user's environment. Perhaps should I use "eval" -- but how...?

Thank you in advance for your help!

Best regards,

Nobumi Iyanaga
Tokyo,
Japan

Try something like

$@ = undef;

#If $@ is the null string, the last eval() parsed and executed correctly
eval { require Foo::Bar };

print "Foo::Bar not installed\n" if $@;

Also see use, require and eval in perlfunc.pod


Regards,
Thomas.


Reply via email to