Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: foreach doesn't select array element

by december (Pilgrim)
on May 04, 2009 at 13:36 UTC ( [id://761722]=note: print w/replies, xml ) Need Help??


in reply to Re^3: foreach doesn't select array element
in thread foreach doesn't select array element

But why does Dump show "a", "b", "c", "d" and not \"a", "b", "c", "d"? It seems to show an ordinary array. You don't need to dereference anything in the following basic array:

[ "anna", "beth", "christie", "denise", ] foreach my $girl (@arr) { print "$girl\n"; }

... and if it's a ref to an array instead of an array itself, shouldn't Dump show \... in my original post? It looks as if it's an ordinary by-value array because there's no slash in front of it to point out it's a reference.

Thanks!

Replies are listed 'Best First'.
Re^5: foreach doesn't select array element
by AnomalousMonk (Archbishop) on May 05, 2009 at 15:19 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-29 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found