coldy has asked for the wisdom of the Perl Monks concerning the following question:
Firstly, it takes a while to do the split - is there a faster method or is that the best I can get out of perl. Secondly, it doesn't loop through the @prob array. Any ideas where Ive gone wrong? Thanks.my $line = <IN>; my @probs = split ',', $line; $i=0; foreach (@probs) { ++$i; if ( $i % 80 != 0){ print OUT "$_"} else{ print OUT "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: break up file with no line breaks
by BrowserUk (Patriarch) on Apr 22, 2009 at 03:04 UTC | |
|
Re: break up file with no line breaks
by ikegami (Patriarch) on Apr 22, 2009 at 02:32 UTC | |
by BrowserUk (Patriarch) on Apr 22, 2009 at 03:10 UTC | |
by ikegami (Patriarch) on Apr 22, 2009 at 03:24 UTC | |
|
Re: break up file with no line breaks
by roboticus (Chancellor) on Apr 22, 2009 at 02:57 UTC | |
|
Re: break up file with no line breaks
by graff (Chancellor) on Apr 22, 2009 at 06:28 UTC |