How to check if a function reference is valid or not?
- From: howachen@xxxxxxxxx (Howa)
- Date: Wed, 28 Nov 2007 02:15:39 -0800 (PST)
sub abc {
print 'abc';
}
my $f1 = \&abc;
my $f2 = \&abcee;
print $f1; # return CODE(0x..)
print $f2; # also return CODE(0x..)
$f1->();
$f2->();
How do I know if $f2 is a valid function reference, without actual
calling it?
Thanks.
.
- Follow-Ups:
- Re: How to check if a function reference is valid or not?
- From: Jeff Pang
- Re: How to check if a function reference is valid or not?
- From: John W . Krahn
- Re: How to check if a function reference is valid or not?
- From: Paul Johnson
- Re: How to check if a function reference is valid or not?
- Prev by Date: Re: Returning multiple MySQL rows from module
- Next by Date: Re: How to check if a function reference is valid or not?
- Previous by thread: can't run mailx as PERL system command
- Next by thread: Re: How to check if a function reference is valid or not?
- Index(es):