If I understand your question correctly, there's no problem with what you want to do -- Perl will return as long a list from split as memory allows (see the documentation on split; if you specify a negative number as the third argument, it will return as many items as are there to be returned).
If you don't know how many items there are going to be, you can just split your string into an array, e.g.:
open IF, "$thefile" or die "Can't open $thefile: $!\n"; # note the 'or die' my @lines = <IF>; #load file into array, line by line close IF; foreach (@lines) { my @array = split ";", $_, -1; # no upper limit on # of items # process @array foreach my $item (@array) { #process $item } }
Note, also, that your input routine, as written, will only grab the first line of the file.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to Re: Split long string MANY times?
by arturo
in thread Split long string MANY times?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |