summaryrefslogtreecommitdiff
path: root/modules/StringProcessor.pm
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-04-04 16:50:31 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-04-04 16:50:31 +0000
commit37b63d8cd9689cde577d21811fee4f0c4d3c575c (patch)
treeb628045cce09e98f4f10281caa469845672494d5 /modules/StringProcessor.pm
parent77913f18f0a5016814fac48a888f6c7b88ea8453 (diff)
downloadMPC-37b63d8cd9689cde577d21811fee4f0c4d3c575c.tar.gz
ChangeLogTag: Fri Apr 4 10:49:29 2003 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/StringProcessor.pm')
-rw-r--r--modules/StringProcessor.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/StringProcessor.pm b/modules/StringProcessor.pm
index 1f025f2b..9bb05eb5 100644
--- a/modules/StringProcessor.pm
+++ b/modules/StringProcessor.pm
@@ -65,16 +65,20 @@ sub create_array {
my($length) = length($line);
my($prev) = 0;
my($double) = 0;
+ my($single) = 0;
for(my $i = 0; $i <= $length; $i++) {
my($ch) = substr($line, $i, 1);
- if (!$double && ($ch eq '' || $ch =~ /\s/)) {
+ if (!$double && !$single && ($ch eq '' || $ch =~ /\s/)) {
my($val) = substr($line, $prev, $i - $prev);
$val =~ s/^\s+//;
$val =~ s/\s+$//;
if ($val =~ /^\"(.*)\"$/) {
$val = $1;
}
+ elsif ($val =~ /^\'(.*)\'$/) {
+ $val = $1;
+ }
push(@array, $val);
for(; $i < $length; $i++) {
if (substr($line, $i, 1) !~ /\s/) {
@@ -91,6 +95,9 @@ sub create_array {
elsif ($ch eq '"') {
$double ^= 1;
}
+ elsif ($ch eq "'") {
+ $single ^= 1;
+ }
}
return \@array;
}