in reply to Help Using Split and Arrays
So split on the commas. More specifically, split on the first two commas only so I don't have to worry about any stray commas in the remainder.
Now, you might find stray whitespace around the commas, so try formulating a fancier pattern to match that.use Data::Dump qw(dump); my $s= 'a,b, this is the rest of the string, dude!'; my @results= split(/,/, $s); print dump \@results;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help Using Split and Arrays
by burningredmoon (Novice) on Apr 23, 2011 at 03:13 UTC | |
by John M. Dlugosz (Monsignor) on Apr 23, 2011 at 04:54 UTC | |
by burningredmoon (Novice) on Apr 24, 2011 at 16:45 UTC |