Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    }
    
    close DB;
    
  2. or download this
    # pseudo representation
    615 = (
    ...
          USED => 12.00
          PB   => 50.00
          )
    
  3. or download this
    keys %data            # 614, 615, 616
    $data{615}            # an anon hashref
    $data{615}{USED}      # 12.00
    keys %{ $data{615} }  # MNH, USED, PB
    
  4. or download this
    for my $key (keys %data) {
        print "\n$key";
        my $h_ref = $data{$key};
        printf "\t%s\t%6.2f\n", $_, $h_ref->{$_} for keys %$h_ref;
    }
    
  5. or download this
    614     MNH      16.00
            USED     32.00
    ...
    616     MNH      96.00
            USED      2.00
            PB       10.00
    
  6. or download this
    $data{ (split/\t/)[0] } = { (split/[\t,|\n]/)[1..6] } while <DB>;