|go ahead... be a heretic|
Re: Probably an easy one - store command in variable.by injunjoel (Priest)
|on Sep 15, 2005 at 19:36 UTC||Need Help??|
I agree with Roy Johnson about the slashes. you are trying to make @results a reference on the left hand side, which is why you are getting the error.
Here are my suggestions for modifying your code.
Now if you wanted the array from $d->checklist() to return as a reference itself you might try.
However if you already have declared @returnstring outside of the scope of your anonymous sub and you wish to use this sub to modify it then you could simply do something like this...
again assuming that $d->checklist() returns an array.
A simple way to think of it is that references get assigned to something. So the \ is allowed on the right hand side only.
At least thats what works for me. :)
These examples are untested but I think, as Roy Johnson pointed out, that your slashes are the problem.
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo