Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: module w/ object-oriented and functional interfaces: best practices?

by BrowserUk (Pope)
on Sep 21, 2012 at 20:22 UTC ( #994988=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    ...
        my( avg, $stddev ) = avgNstddev( $bigStruct->{something}{something
    +else} ); ## hash expression yields an array ref.
    ...
    
  2. or download this
    ...
        my $stats = Stats:Mod->new;
    ...
        my $stddev = $stats->stddev;
        $stats->empty;
    ...
    
  3. or download this
    for my $something ( keys %bigstruct ) {
        for my $somethingelse ( keys %{ $bigstruct->{ $something } } ) {
             ...
        }
    }
    
  4. or download this
    my $stats = Stats::Module->new( $bigstruct->{ $something }{ $something
    +else } );
    my( $avg = ( $stats->average, $stats->stddev );
    $stats->done;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994988]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2014-10-22 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls