Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re^4: foreach doesn't select array element

by december (Pilgrim)
on May 04, 2009 at 13:36 UTC ( #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.


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?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2023-03-22 05:44 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.