kevind0718 has asked for the wisdom of the Perl Monks concerning the following question:
The split is not working. I have other code when split works just fine. But I do not see my silly mistake here. This what the code returns.open ( txtFileIn, $ARGV[0] ) || die ("Could NOT open " . $ARGV[0] . + ".\n"); @txtFileIn = <txtFileIn>; print scalar @txtFileIn ; foreach $row (@txtFileIn) { chomp($row); print "\n" . index ($row , '|'); ($size, $item) = split /|/, $row; print "\n**",$row, $size, $item ; chomp($size); chomp($item); $cnt = $item =~ s/(\\)/$1/gi; $item .= ('|' x $cnt ) . $item ; # print "\n" , $size . $item, $cnt; } #foreach row close txtFileIn;
12 ** 1.7 MB | Z: \PeachTree\Forms 12 ** 601.3 KB | Z: \PeachTree\Reports 12 ** 149.0 KB | Z: \PeachTree\Letters 12 ** 593.4 MB | Z: \Marketing Department 12 ** 425.4 MB | Z: \Marketing Department\Presentations 12 ** 92.9 MB | Z: \Marketing Department\Other
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: simple simple split
by moritz (Cardinal) on Nov 01, 2007 at 16:52 UTC | |
by kevind0718 (Scribe) on Nov 01, 2007 at 17:29 UTC | |
|
Re: simple simple split
by skx (Parson) on Nov 01, 2007 at 16:52 UTC | |
|
Re: simple simple split
by BrowserUk (Patriarch) on Nov 01, 2007 at 16:52 UTC | |
|
Re: simple simple split
by eff_i_g (Curate) on Nov 01, 2007 at 17:17 UTC |