in reply to Cannot find error : Can't use string ("9") as an ARRAY ref while "strict refs" ...

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."
  • Comment on Re: Cannot find error : Can't use string ("9") as an ARRAY ref while "strict refs" ...

Replies are listed 'Best First'.
Re^2: Cannot find error : Can't use string ("9") as an ARRAY ref while "strict refs" ...
by smoky (Novice) on Mar 12, 2009 at 16:37 UTC
    spot on guys, cheers!