Help for this page

Select Code to Download


  1. or download this
    my @line_format = (
        [ 'ssn',        qr/(\d{9})/ ],
    ...
        [ 'city',       'COUNT' ],
        [ 'zip',        qr/(\d{5})/ ],
    );
    
  2. or download this
    sub parse_line {
        my ($line, $linenum) = @_;
    ...
    
        return \%parsed;    
    }
    
  3. or download this
        use Data::Dumper::Concise;
        my $line   = "123445678 45612 11 Steve Smith 11012015 16 1001 Main
    + Street GA 7 Atlanta 30553";
        my $result = parse_line($line, 1);
        die Dumper $result;
    
  4. or download this
    {
      city => "Atlanta",
    ...
      state => "GA",
      zip => 30553
    }