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