Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: adding items, but with interim results

by LanX (Chancellor)
on Mar 31, 2013 at 00:24 UTC ( #1026310=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
       DB<104> @x=1..4
     => (1, 2, 3, 4)
    ...
    
      DB<106> my $z; my @y = map { $z += $_ } @x;
     => (1, 3, 6, 10)
    
  2. or download this
      DB<107> my @y; { 
               my $z;
    ...
    
      DB<109> my @y = do { my $z; map { $z += $_ } @x }
     => (1, 3, 6, 10)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2016-02-08 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (286 votes), past polls