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

List-to-Scalar Function?

by Masem (Monsignor)
on May 09, 2001 at 02:08 UTC ( [id://78977]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $i;
    for (0..10) {
      $i += $_;
    }
    
  2. or download this
    my $sum = operate { $~ + $_ } (0..10);
    
  3. or download this
    #Max:
    my $max = operate { $~ > $_ ? $~ : $_ } @list;
    ...
    my $string = operate { $~.$_ } @list; 
    #Count occurences of words in a file:
    my $count = operate { $~ + /the/ } <FILE>;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-23 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found