Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: foreach on array

by shenme (Priest)
on Oct 13, 2005 at 07:46 UTC ( [id://499804]=note: print w/replies, xml ) Need Help??


in reply to foreach on array

Try it without the '[' and ']'?
push @inpfile, split /\n/;

The '[' and ']' surrounding the split put the result into an "anonymous array", then you push the reference to the anonymous array onto @inpfile. Later when you print one of those values you see 'ARRAY(...)', which it is, an array reference.

Were you perhaps thinking you wanted
push @inpfile, ( split /\n/ );

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-19 18:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found