Do you know where your variables are? | |
PerlMonks |
Simple Pass By Referenceby tomazos (Deacon) |
on Jul 25, 2005 at 23:50 UTC ( [id://478021]=perlquestion: print w/replies, xml ) | Need Help?? |
tomazos has asked for the wisdom of the Perl Monks concerning the following question:
This seems like something that should be simple, and I am most likely missing something.
I want to pass a my variable to a subrountine that then does something to it.
Any ideas as to what goes in the ??? bits? Essentially I want to make $var_in_sub an alias for $_[0]. Update: In the actual application the scalar is quite big, so I'd like to pass it by reference without copying the data. I'd also like to use a meaningful name rather than $_[0] throughout the subroutine. I'd also like to not have to reference (\$) and dereference ($$) all over the place. I just want too much. :) Lexical::Alias is what I want but I'm running 5.6.1, looks like 5.8.1+ is needed from the docs. All bow to BrowserUK. Truly cool. -Andrew.
Back to
Seekers of Perl Wisdom
|
|