On Wednesday 05 May 2010, Harry Putnam wrote:
> But even though I can work with that... I'm still not seeing why the
> values in @_ are not available at the call to N() inside like this: 
> (incomplete code)
> 
> func($val1,$val2);
> 
> sub func { %h = ( N => sub { print N(@_#HERE) . "\n"; } ); }

If you're trying to use the arguments passed to the subroutine 'func' in the 
code reference of $h{N}, It can't be done. The code reference here is another 
subroutine under the subroutine func and the arguments list of a subroutine is 
not the argument list of another subroutine inside that.

>>print N(@_#HERE)
Why are you calling the subroutine N? Have you already defined a subroutine 
with the name N in your program? 

-- 
Regards,
Akhthar Parvez K
http://Tips.SysAdminGUIDE.COM
UNIX is basically a simple operating system, but you have to be a genius to 
understand the simplicity - Dennie Richie

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to