in reply to split a string into four parts on comma

There would be many ways to do this, ranging from kind of tricky to very complicated. Have you even taken a stab at this yourself, or do you just want us to write your code for you?

Edit: nevermind, ikegami just wrote your code for you :)

-driver8
  • Comment on Re: split a string into four parts on comma

Replies are listed 'Best First'.
Re^2: split a string into four parts on comma
by Anonymous Monk on Oct 25, 2006 at 02:43 UTC
    This is the best I did...
    my $string = "TE=ASR,EV=R,PPF=G1,TG=G1,TMT=P1,RTV=YE,AAT=0,AT=105,ON=Y +,CF1=FGOC"; my @system_options = split /,/, $string; print @system_options[0 .. 9], "\n"; print @system_options[10 .. 19], "\n"; print @system_options[20 .. 29], "\n"; print @system_options[30 .. 39], "\n";
    It only works if you know the number of items in the array.
Re^2: split a string into four parts on comma
by Anonymous Monk on Oct 25, 2006 at 02:36 UTC
    I made many attemps but the results were soooo far off, I decided not to post them.