in reply to split problem...
I got:$itDetail = '22009^1^52.90' . "\015\012" . '22010^1^42.90' . "\015\012" . '22011^1^32.90' . "\015\012"; while($itDetail) { (my $_line, $itDetail) = split /\015\012/, $itDetail, 2; (my $Num, $_line) = split /\^/, $_line, 2; my ($Qt, $_trashit) = split /\^/, $_line, 2; print "$Num $Qt $_trashit\n"; }
So it's working for me. An alternate, neater method of doing this would be, however:22009 1 52.90 22010 1 42.90 22011 1 32.90
$itDetail = '22009^1^52.90' . "\015\012" . '22010^1^42.90' . "\015\012" . '22011^1^32.90' . "\015\012"; while ($itDetail =~ /(\d+)\^(\d+)\^(\d+\.\d+)\015\012/g) { print "$1 $2 $3\n"; }
|
|---|