Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Printing the elements of array

by Not_a_Number (Parson)
on Jan 16, 2012 at 17:47 UTC ( #948188=note: print w/ replies, xml ) Need Help??


in reply to Printing the elements of array

use strict; use warnings; my @array = ( 5, 4, 10 ); my $start = 1; my $sum = 0; for my $num ( @array ) { $sum += $num; print "$start-$sum\n"; $start += $num; }


Comment on Re: Printing the elements of array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2014-08-23 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls