rsmah has asked for the wisdom of the Perl Monks concerning the following question:
I have a bit of a problem. I want to know if an argument to a sub is a variable or a constant, that is, is it an lvalue or not?
Let's say I call a function called foo thusly...
Inside foo(), I'd like to be able to determine that $_[0] is a variable (and thus an lvalue) and that $_[1] is a constant (and thus not an lvalue). Any ideas on how?foo($a, "b");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do you tell if a sub argument is an lvalue?
by diotalevi (Canon) on Feb 10, 2007 at 21:24 UTC | |
Re: How do you tell if a sub argument is an lvalue?
by bart (Canon) on Feb 10, 2007 at 21:32 UTC | |
by rsmah (Scribe) on Feb 10, 2007 at 21:41 UTC | |
Re: How do you tell if a sub argument is an lvalue?
by liverpole (Monsignor) on Feb 10, 2007 at 20:57 UTC | |
Re: How do you tell if a sub argument is an lvalue?
by rinceWind (Monsignor) on Feb 11, 2007 at 00:14 UTC | |
by ikegami (Patriarch) on Feb 11, 2007 at 16:27 UTC |
Back to
Seekers of Perl Wisdom