Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my @headers = split /\t/, shift @lines;
    my @records = map [ split /\t/ ], @lines;
    1;
    
  2. or download this
    % perl -d munge.pl
    Loading DB routines from perl5db.pl version 1.23
    ...
    
    main::(munge.pl:4):    chomp( my @lines = do { local @ARGV = 'mongo.ta
    +b'; <> } );
      DB<1>
    
  3. or download this
      DB<1> c 7
    main::(munge.pl:7):    1;
      DB<2>
    
  4. or download this
      DB<2> p scalar @records
    16215
      DB<3> p scalar @headers
    118
      DB<4>
    
  5. or download this
      DB<4> $h{ $_ }++ for map $_->[ 0 ], @records
      DB<5> p scalar keys %h
    16215
      DB<6>
    
  6. or download this
      DB<6> $h2{ $_ }++ for map $_->[ 1 ], @records
      DB<7> p scalar keys %h2
    9027
    
  7. or download this
      DB<8> p ( sort { $h2{ $b } <=> $h2{ $a } } keys %h2 )[ 0 ]
    
      DB<9>
    
  8. or download this
      DB<10> p $h2{''}
    2904
      DB<11>
    
  9. or download this
      DB<12> p ( sort { $h2{ $b } <=> $h2{ $a } } keys %h2 )[ 1 ]
    "BBX "
    
  10. or download this
    my $re = qr/ *\t */;
    my @headers = split /$re/, shift @lines;
    my @records = map [ split /$re/ ], @lines;
    
  11. or download this
      DB<13> R
    Warning: some settings and command-line options may be lost!
    ...
    
    main::(munge.pl:4):    chomp( my @lines = do { local @ARGV = 'mongo.ta
    +b'; <> } );
      DB<12>