go ahead... be a heretic | |
PerlMonks |
Re: Cannot find error : Can't use string ("9") as an ARRAY ref while "strict refs" ...by dreadpiratepeter (Priest) |
on Mar 12, 2009 at 16:24 UTC ( [id://750207]=note: print w/replies, xml ) | Need Help?? |
the $#{} construct is a deref and expects a reference. you passed it @$head, which is an array, not an arrayref. the array in scalar context gives the number of elements in it. since the $#{} construct needs a reference, which is a scalar, you are passing it 9
-pete "Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."
In Section
Seekers of Perl Wisdom
|
|