>>>>> "HP" == Harry Putnam <[email protected]> writes:
HP> A third sub function is called in the dispatch table ( N(@_); ) but
HP> the variables don't survive to be use there.
there are no variables to survive in a sub, just passed arguments in @_
HP> The output from the script below:
HP> Shows 6 elements arrive in dispt($g, @ar) as @_. But when sub N(@_)
HP> is called, no variables arrive there. @_ is empty. When it seems like
HP> 5 elements should have arrived there
well, it helps if you actually pass in arguments. @_ is NOT a global.
HP> my $code = $dispt{$selection} || $dispt{'error'} ;
HP> $code->();
you aren't passing anything in to $code. you need to put something in
the () which then is set in the @_ of the called sub.
uri
--
Uri Guttman ------ [email protected] -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/