Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: how do foreach and while affect an array?

by ikegami (Patriarch)
on Sep 12, 2004 at 17:13 UTC ( [id://390447]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @a = qw( food foot );
    foreach (@a) { s/foo/bar/g }
    # @a is now qw( bard bart )
    
  2. or download this
    sub visit_breadth_first {
       my ($node, $visitor) = @_;
    ...
          &$visitor($current);
       }
    }
    
  3. or download this
    @a = map  { ... transformation ... } @a;
    @a = grep { ... filter         ... } @a;
    @a = sort { ... equiv test     ... } @a;
    

Log In?
Username:
Password:

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

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

    No recent polls found