perl:index
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| perl:index [2009/08/13 09:56] – Links to command_line_options_with_usage changed to perl:command_line_options_with_usage tkbletsc | perl:index [2010/01/08 13:50] (current) – tkbletsc | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | * [[: | + | * [[Prototype class for OO]] |
| - | * [[:ansi_color]] | + | * [[Real CSV Parsing]] |
| - | * [[:sets]] | + | * [[ANSI color]] |
| - | * [[:dns_stuff]] | + | * [[Sets]] |
| - | * [[: | + | * [[DNS stuff]] |
| - | * [[: | + | * [[Make a loop parallel]] |
| - | * [[: | + | * [[Command line options and usage with Getopt Long]] |
| - | * [[command_line_options_with_usage]] | + | * [[Command line options and usage with getopts]] |
| - | * [[for_each_file]] | + | * [[command line options with usage]] |
| - | * [[forking_server]] | + | * [[For each file]] |
| + | * [[Forking server]] | ||
| * [[kvpff]] | * [[kvpff]] | ||
| - | * [[loop_with_timekeeping]] | + | * [[Loop with timekeeping]] |
| - | * [[single_document_web_server]] | + | * [[Single document web server]] |
| - | * [[read_password_without_echo]] | + | * [[Read password without echo]] |
| + | * [[Amazon preview leech]] | ||
| - | ====== | + | ====== |
| <code perl> | <code perl> | ||
| Line 24: | Line 26: | ||
| sub sum { my $r=0; for (@_) { $r += $_ }; return $r; } | sub sum { my $r=0; for (@_) { $r += $_ }; return $r; } | ||
| sub avg { return sum(@_)/@_; } | sub avg { return sum(@_)/@_; } | ||
| + | sub stdev { | ||
| + | my $s=0; | ||
| + | my $avg = avg(@_); | ||
| + | foreach (@_){ | ||
| + | $s += ($_ - $avg)**2; | ||
| + | } | ||
| + | return sqrt($s/ | ||
| + | } | ||
| sub limits { | sub limits { | ||
| my $lo = my $hi = $_[0]; | my $lo = my $hi = $_[0]; | ||
| Line 67: | Line 77: | ||
| '< | '< | ||
| } | } | ||
| + | |||
| + | sub size_units { | ||
| + | my ($n) = @_; | ||
| + | if ($n> | ||
| + | if ($n> | ||
| + | if ($n> | ||
| + | if ($n> | ||
| + | return $n; | ||
| + | } | ||
| + | |||
| + | sub parse_size_units { | ||
| + | my ($s) = @_; | ||
| + | if ($s=~/ | ||
| + | if ($2 eq ' | ||
| + | elsif ($2 eq ' | ||
| + | elsif ($2 eq ' | ||
| + | elsif ($2 eq ' | ||
| + | else | ||
| + | } else { | ||
| + | return undef; | ||
| + | } | ||
| + | } | ||
| + | |||
perl/index.1250182606.txt.gz · Last modified: by tkbletsc
