The stupid question is the question not asked | |
PerlMonks |
unshifting by referenceby palkia (Monk) |
on Dec 16, 2011 at 00:25 UTC ( [id://943858]=perlquestion: print w/replies, xml ) | Need Help?? |
palkia has asked for the wisdom of the Perl Monks concerning the following question:
Hi I got this var $this->{M} which is an array & $this->{S} which is a scalar. (those are part of a bigger structure which I can't alter) The problem is when I try unshift($this->{M},$this->{S}); it says Type of arg 1 to unshift must be array (not hash element) it says the same even when I avoid using strict. so I tried unshift(@this->{M},$this->{S}); and it said Global symbol "@this" requires explicit package name so I tried unshift(@($this->{M}),$this->{S}); and it said Scalar found where operator expected yeah I'm sure I'm missing something really oblivious, but I'm getting tired of the sight of my own tail. your thoughts ? Thx
Back to
Seekers of Perl Wisdom
|
|