in reply to Closures question
and it worked just fine.sub doStuff { my $toggle = initToggle( 1 ); blah($toggle); } sub blah { my $t = shift; for ( 1..6 ) { print &$t . "\n" } }
Are you doing something differently than the above? Are you storing your code ref as the key in a hash, then pulling it back out and trying to use it again? If so the ref will be stringified and thereafter useless as a code ref. In fact, any stringification of your reference will render it unusable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Closures question
by cianoz (Friar) on Oct 20, 2000 at 01:40 UTC | |
by btrott (Parson) on Oct 20, 2000 at 02:04 UTC |