Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: map split vs array split

by ikegami (Patriarch)
on Jul 31, 2007 at 00:09 UTC ( [id://629708]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @array = map { EXPR } LIST;
    
  2. or download this
    @array = ();
    foreach (LIST) {
       push @array, EXPR;
    }
    
  3. or download this
    open (FH, "foo.txt");
    my @words = map { split } <FH>;
    close FH;
    print "@words\n";
    
  4. or download this
    open (FH, "foo.txt");
    my @words;
    ...
    }
    close FH;
    print "@words\n";
    
  5. or download this
    open (FH, "foo.txt");
    my @words;
    ...
    }
    close FH;
    print "@words\n";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-28 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found