Help for this page

Select Code to Download


  1. or download this
    use Text::CSV_XS;
    
    my $csv = Text::CSV_XS->new ({ binary => 1, eol => "\r\n", auto_diag =
    +> 1 });
    
  2. or download this
    $csv->print (OUT, \@heading);
    
  3. or download this
    $csv->print (OUT, [ $_ ]) for @arr;
    
  4. or download this
    while (my $row = <IN>) {
        push @arr, [ unpack "x0 A12 ..." => $row ];
        }
    # @arr now holds a list of array refs
    $csv->print (OUT, $_) for @arr;