![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Re: return Both ARRAY and SCALARby jhourcle (Prior) |
on May 01, 2009 at 13:25 UTC ( #761287=note: print w/replies, xml ) | Need Help?? |
You wouldn't have gotten that behaviour if you had 'use strict'. You're not actually overloading, what's happening is that you're assigning to an array based on the name of the variable:
Once it's in a module, '@one' is out of scope. If you really want this exact behaviour, you're likely going to need to look into a tied array that stringifies to your 'scalar' value.
In Section
Seekers of Perl Wisdom
|
|