Help for this page

Select Code to Download


  1. or download this
    use Text::ParseWords;
    @fields = ();
    ...
    foreach $field (0..$#fields) {
        print $field + 1 . " $fields[$field]\n";
    }
    
  2. or download this
    my $file = $ARGV[0] or die "Missing CSV file on the command line\n";
    open($text, '<', $file) or die "Could not open '$file' $!\n";
    ...
    foreach $field (0..$#fields) {
        print $field + 1 . " $fields[$field]\n";
    }