Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: problem printing array elements -- printing # of lines in array instead

by davorg (Chancellor)
on Jul 13, 2009 at 13:42 UTC ( [id://779584]=note: print w/replies, xml ) Need Help??


in reply to problem printing array elements -- printing # of lines in array instead

It all goes wrong on your line 46. As you'll see from the documentation, the second argument to split is a scalar value. Therefore your array is evaluated in scalar context and returns the number of elements in the array.

It's also (as always) worth using strict and warnings. In this case, you'll see warnings like "Scalar value @command_array_split[0] better written as $command_array_split[0]".

--

See the Copyright notice on my home node.

Perl training courses

  • Comment on Re: problem printing array elements -- printing # of lines in array instead

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-04-23 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found