On Fri, 24 Aug 2001, Michael Dube wrote:

> I have a script that uses require to include additional perl scripts at
> runtime.  I would like to call a function if and only if that function is
> defined in the required module.  How would this be done?  Would the define()
> function work?  Here's some pseudo of what I intend... any ideas?
>
> require runtime.pl;
>
> if (defined(runtimefunction)) {
>       runtimefunction(args);
> }

I would wrap the call in an eval and then catch any run time exceptions:

eval {

        runtimefunction();
};

print $@ if $@;

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
If time heals all wounds, how come the belly button stays the same?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to