Help for this page

Select Code to Download


  1. or download this
    ^L
    
    ...
    and here is data line 2
    and 3 here
    EOE
    
  2. or download this
    use strict;
    use warnings;
    ...
       or die qq{close: $headerFile: $!\n};
    close $detailFH
       or die qq{close: $detailFile: $!\n};
    
  3. or download this
    use strict;
    use warnings;
    ...
       or die qq{close: $headerFile: $!\n};
    close $detailFH
       or die qq{close: $detailFile: $!\n};
    
  4. or download this
    my $detailsLinesWritten = 0;
    
  5. or download this
    my @items = split m{\n}, $record, 17;
    
  6. or download this
    my $details = pop @items;
    my $detailsLineCt = ($details =~ tr/\n//);
    
  7. or download this
    print $detailFH $details;
    $detailsLinesWritten += $detailsLineCt;
    
  8. or download this
    sub stripSpaces
    {
    ...
           ? $1
           : q{};
    }
    
  9. or download this
    my $fld2  = q{Some company text};
    my $fld3  = q{Some other company text};
    ...
    my $fld5  = q{};
    ...
    my $fld14 = q{};
    
  10. or download this
    my $fld1  = q{};
    my $fld6  = q{};
    ...
    my $fld15 = q{};
    
  11. or download this
    my ($fld1, $fld6, $fld7, $fld8, $fld11, $fld12, $fld15)
       = (q{}) x 7;
    
  12. or download this
    $fld1 = stripSpaces($items[6]);
    
  13. or download this
    # Pull out two dates from line 12 with a global match of
    # 2 digits, a space, three letters, a space 4 digits. The
    ...
       =~ s{(\d\d)\s([A-Za-z]{3})\s\d\d(\d\d)}{$1 . $2 . $3}e;
    ($fld12 = $endPeriod)
       =~ s{(\d\d)\s([A-Za-z]{3})\s\d\d(\d\d)}{$1 . $2 . $3}e;
    
  14. or download this
    my $line3 = stripSpaces($items[1]);
    my $line4 = stripSpaces($items[2]);
    ...
    {
        $fld6  = $line4;
    }
    
  15. or download this
    my $str1 = q{abc};
    my $str2 = q{zyxwvut};
    my $template = q{A5A5};
    my $packed = pack $template, $str1, $str2;
    print qq{>$packed<\n};
    
  16. or download this
    >abc  zyxwv<
    
  17. or download this
    my $hdrTemplate
       = q{A18}
    ...
       . q{A40}
       . q{A8}
       . q{A6};
    
  18. or download this
    my $headerStr = pack $hdrTemplate
       , $fld1
    ...
       , $detailsLinesWritten
       , $detailsLineCt;
    print $headerFH qq{$headerStr\n};