The easiest way is to call prototype. It dies if the
function doesn't exist.

sub function_exists { 
   eval { prototype $_[0] }; 
   return ! $@ 
}

if ( function_exists("whatever") ) {
...
}

> [EMAIL PROTECTED] wrote:
> 
> : I am writing a perl code which automatically forms a
> : function name using certain criteria and then calls the
> : same
> 
>     It would probably be safer to use a hash table for
> that.
> 
> : I tired using the following code
> : doesnt seem to work
> : 
> : my $func = \&TEST3;
> 
=== message truncated ===



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to