Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Replacing values in an array

by muba (Priest)
on Jan 27, 2013 at 05:37 UTC ( #1015562=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @numbers = (0, 0.5, 1, 1.5, 2, 2.5);
    
    ...
    
    my @basket_1 = grep defined, @basket;
    print "The number of *defined* elements in \@basket is ", scalar(@bask
    +et_1), "\n";
    
  2. or download this
    my @numbers = (0, 0.5, 1, 1.5, 2, 2.5);
    
    ...
        push @basket_1, $_ if defined;
    }
    print "The number of *defined* elements in \@basket is ", scalar(@bask
    +et_1), "\n";
    
  3. or download this
    my @numbers = 1..10;
    my @times_ten = map { $_ * 10 } @numbers;
    print join(", ", @times_ten), "\n";
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-04-19 02:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (475 votes), past polls