Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Adding scalars but with a twist..

by Dietz (Curate)
on Feb 13, 2005 at 09:51 UTC ( #430558=note: print w/ replies, xml ) Need Help??


in reply to Adding scalars but with a twist..

#!/usr/bin/perl use strict; use warnings; my $Sel1Ttl = 1; my $Sel2Ttl = 2; my $Sel3Ttl = 3; my $result; for ($Sel1Ttl..$Sel3Ttl) { $result += $_; } print "$result\n"; # gives 6

Update:
Sorry, this is just interpolating the variable values and using it for a range, thus it is giving nonsense if there are different values


Comment on Re: Adding scalars but with a twist..
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (19)
As of 2015-07-29 14:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls