Perl concise Programming, "Perl Language Primer (Fifth Edition)" Reading notes

Source: Internet
Author: User
Tags tidy



Tidy up the notes you put on Hi.baidu years ago!





Perl concise Programming, "Perl Language Primer (Fifth Edition)" Reading notes 20110316!


The book was bought very early, simply turned over and dropped!
Recently bought an ipad, a good reading experience, used to read books, feel the book can look in!
You can't look it over and tidy up your reading notes!



Perl's program can be so concise!!!


sub division  {
    $_[0]/$_[1];
}


The $_ is the received array, and the data is returned directly after the operation, omitting the return.


sub max {my ($ max_so_far) = shift @_; #The first value in the array, initially set to the maximum value
     foreach (@_) {#Iterate through other elements in array @_
         if ($ _> $ max_so_far) {#When the current element is larger than $ max_so_far
             $ max_so_far = $ _;
         }
     }
     $ max_so_far;
} 


function parameter receive, @_ for function, that is all parameters









Perl concise Programming, "Perl Language Primer (Fifth Edition)" Reading notes


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.