sub min_and_max { my @values = @_; my @sorted = sort { $a <=> $b } @values; return ($sorted[0], $sorted[$#sorted]); } ($min, $max) = min_and_max(128, 118, 75, 10, 33, 990); |
sub extract_urls { my $html_doc = shift; # some regular expression work here return \@urls; } $array_reference = extract_urls($my_document); @array_of_urls = @$array_reference; |
Forward to 20 Minutes: Regular Expressions I
Back to 20 Minutes: Subroutines Up to PerlInside section index Up to Perl Inside course index |
Perl Inside: PerlInside - 12
Copyright © 1999, Brian Jepson
|