Re: How to check if a function reference is valid or not?
- From: howachen@xxxxxxxxx (Howa)
- Date: Wed, 28 Nov 2007 07:17:24 -0800 (PST)
On 11月28日, 下午8時36分, kra...@xxxxxxxxx (John W . Krahn) wrote:
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
Thanks all
Howard
.
- 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
- Re: How to check if a function reference is valid or not?
- From: John W . Krahn
- How to check if a function reference is valid or not?
- Prev by Date: Re: Time Comparison Easier Than I'm Making them
- Next by Date: RE: fixed list combinatorics
- Previous by thread: Re: How to check if a function reference is valid or not?
- Next by thread: fixed list combinatorics
- Index(es):
Relevant Pages
|
|