Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Adding scalars but with a twist..

by Anonymous Monk
on Feb 14, 2005 at 10:05 UTC ( #430731=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $sum = 0;
    foreach my $i (1 .. 80) {
        no strict 'refs';
        $sum += ${"Sel${i}Ttl"};
    }
    
  2. or download this
    my $sum = 0;
    foreach my $i (1 .. 80) {
        $sum += do {eval "$Sel${i}Ttl"}
    }
    
  3. or download this
    my $sum = 0;
    local $" = "+";
    eval "\$sum = @{[map {qq {\$Sel${_}Ttl}} 1 .. 80]}";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2022-05-28 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (99 votes). Check out past polls.

    Notices?