Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Getting a result from "foreach" block

by CountZero (Bishop)
on Jun 25, 2014 at 14:28 UTC ( [id://1091199]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @results;
    foreach (@data) {
       $_ = $_ * 13;
       push @results, $_;
    }
    
  2. or download this
    my @results;
    push @results, $_*13 for @data;
    
  3. or download this
    my @results = map $_*13, @data;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found