Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Interactive scripting with debugger

by tlm (Prior)
on May 26, 2005 at 02:10 UTC ( [id://460486]=perlmeditation: print w/replies, xml ) Need Help??

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>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://460486]
Approved by Zaxo
Front-paged by dragonchild
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2024-04-26 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found