Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://750207]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 19:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found