M
Mia
Hi All,
I'm trying to parse a string into an array of words or phrases,
something like:
my $string = "abc def ghi";
my @words = split(/ /,$string);
....but I also want to handle the case where there are quoted phrases
within the string, i.e.:
my $string = 'abc "def ghi"';
or
my $string = "abc 'def ghi'";
I want to preserve the quoted phrase as one element. Such a simple
thing, one would think, but I've not found a technique yet.
Anyone have a hint for me?
-Mia
I'm trying to parse a string into an array of words or phrases,
something like:
my $string = "abc def ghi";
my @words = split(/ /,$string);
....but I also want to handle the case where there are quoted phrases
within the string, i.e.:
my $string = 'abc "def ghi"';
or
my $string = "abc 'def ghi'";
I want to preserve the quoted phrase as one element. Such a simple
thing, one would think, but I've not found a technique yet.
Anyone have a hint for me?
-Mia