in reply to Parsing Form Input
substr can help with carving up a string, and if you use it coupled with an array, you could easily tell how many chunks you split the string into by seeing how big the array is...
my @chunks; while ( 1 ) { my $chunk = substr( $initial, 0, 100, "" ); last unless length $chunk; # was it empty? push @chunks, $chunk; } print scalar(@chunks), " chunks\n";
--k.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Parsing Form Input
by particle (Vicar) on Apr 22, 2002 at 12:18 UTC |