Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This makes it possible to change $variable without changing $$variableRef1 which is what I want. I want to use this in a loop where i give $variable different values but want a copy of each value, but only 1 copy and an unknown number of references to this one copy. How can I do this without constructing an anonymous array (or hash) and consume minimal time and memory?$variable = "something"; $variableRef1 = \[ $variable ]->[ 0 ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I create an anonymous scalar?
by suaveant (Parson) on Jul 26, 2001 at 17:57 UTC | |
|
Re: How can I create an anonymous scalar?
by merlyn (Sage) on Jul 26, 2001 at 18:31 UTC | |
|
Re: How can I create an anonymous scalar?
by PrakashK (Pilgrim) on Jul 26, 2001 at 18:19 UTC | |
by Anonymous Monk on Jul 27, 2001 at 10:21 UTC |