|
Stephenos Beginner
Joined: 06 Jul 2007 Posts: 27
|
Posted: Sat Aug 01, 2009 1:00 am
How do I... |
I am trying to make a generalized queue or stack management routine and am having trouble with %pop and assignments.
I know that %pop takes the name of a list not the list itself. I also know I assign to the name of a variable, not what is currently in the variable.
Is there a way to do these things when the name of a variable (or list variable) is stored in another, local variable.?
If x = 1|2 and $name = x is there a way to do something like %pop(x), but by working on the $name variable? I tried %pop({$name}) and that didn't work.
Is there a way to assign a new value to x indirectly through the $name variable?
Thanks |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Aug 03, 2009 6:50 am |
%pop(%string($name))
#var %string($name) value
#say $name is @{$name} |
|
|
|
Stephenos Beginner
Joined: 06 Jul 2007 Posts: 27
|
Posted: Mon Aug 03, 2009 10:43 pm |
Very cool, Fang. Thanks!
|
|
|
|
|
|