----- Original Message ----- 
From: "Michael Jung"
.
.
>
> ++++++++++++ example code +++++++++++++++++
>
> use strict;
> use warnings;
> use File::Copy;
>
> eval {
>   copy("/somepath/foo.dbf", "/someotherpath/work/");
> };
> if ($@) {
>   print "Error" . "\n";
> }
> print "End of program" . "\n";
>
> +++++++++++++++++++++

I find in the File::Copy docs:

"RETURN
    All functions return 1 on success, 0 on failure. $! will be set if an
    error was encountered."

On the strength of that, I would dispense with eval, and try something like:

if(!copy("/somepath/foo.dbf", "/someotherpath/work/")) {print "Error: $!"}

You'll mainly use eval like that to trap and report any "die" calls. In your
case, although the function fails, that's not a fatal error - hence there's
nothing for eval to trap, and nothing to get put into [EMAIL PROTECTED]

It's just standard eval behaviour (see 'perldoc -f eval') and has nothing to
do with the fact that you're using a module.

Cheers,
Rob

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to