B
Bill
I am trying to split the following line into a list of just the
numbers. It is a list of xy coordinates.
<-250,-850> <-250,800> <200,800> <200,-850> <-250,-850>
I can use split() with comma, and ">", but not "<". The following
code works, but I can not add "<" to the regular expression used by
split(). I have tried various combinations of "\<" with and without
quotes without success. Any ideas?
Thanks.
$tmpline = "<-250,-850> <-250,800> <200,800> <200,-850> <-250,-850>";
(@grphdata) = split(/[\,>]/,$tmpline);
print $tmpline . "\n";
$i2 = 0;
while ($grphdata[$i2]){
print $i2 . " " . $grphdata[$i2] . "\n";
$i2++;
}
numbers. It is a list of xy coordinates.
<-250,-850> <-250,800> <200,800> <200,-850> <-250,-850>
I can use split() with comma, and ">", but not "<". The following
code works, but I can not add "<" to the regular expression used by
split(). I have tried various combinations of "\<" with and without
quotes without success. Any ideas?
Thanks.
$tmpline = "<-250,-850> <-250,800> <200,800> <200,-850> <-250,-850>";
(@grphdata) = split(/[\,>]/,$tmpline);
print $tmpline . "\n";
$i2 = 0;
while ($grphdata[$i2]){
print $i2 . " " . $grphdata[$i2] . "\n";
$i2++;
}