Re: How to check if a function reference is valid or not?
- From: krahnj@xxxxxxxxx (John W . Krahn)
- Date: Wed, 28 Nov 2007 04:36:28 -0800
On Wednesday 28 November 2007 04:14, Jeff Pang wrote:
for (keys %::) {
print "$_ -> $::{$_}\n" if /abc/;
}
__END__
the output is:
abcee -> *main::abcee
abc -> *main::abc
that's to say, when you say $f2 = \&abcee you have created an entry
in this script's symbol table.
Correct.
so, abcee can be anything (a hash, an
array, a scalar, a subroutine, a handler etc).
No, it is assigning a code reference so only the *main::abcee{CODE}
slot in the symbol table will be in use.
If you had said:
use vars '*abcee';
then abcee could be anything.
John
--
use Perl;
program
fulfillment
.
- Follow-Ups:
- References:
- How to check if a function reference is valid or not?
- From: Howa
- Re: How to check if a function reference is valid or not?
- From: Jeff Pang
- How to check if a function reference is valid or not?
- Prev by Date: Re: can't run mailx as PERL system command
- Next by Date: Re: Returning multiple MySQL rows from module
- Previous by thread: Re: How to check if a function reference is valid or not?
- Next by thread: Re: How to check if a function reference is valid or not?
- Index(es):
Relevant Pages
|
|