> I have an array like this
> @path =
> ( 'C:\path1\script1.pl' ,
> 'C:\path1\script2.pl' ,
> 'C:\path2\script1.pl' ,
> 'C:\path2\script2.pl' );
>
> Then I tried this :
> require "$_" for (@path);
>
> It goes fail...
>
> Questions :
> 1. How can I know if a "require" is success or not ?
> 2. Anything wrong for what I wrote ?
Require die()s in case of a problem. Therefore you will want to wrap
it in an eval{} block:
for (@path) {
eval {
require $_;
};
if ($@) {
print qq{require "$_" FAILED :\n$@\n};
}
}
Also it's not very helpful to say "It goes fail...". You probably got
some error message, you should have included it in your mail.
Jenda
=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]