J.H.M.Dassen writes: > ------------------------------------------------------------ > #!/usr/bin/perl > > @array=( > "item1 4 units", > "item2 1.5 units", > "item3 8 units + see item2" > ); > > foreach (@array) { > if( ($item_name,$amount,$unit,$delimiter,$moreinfo)= > /^(\w+)\s*([\d\.]+)\s*(\w+)\s*(\+|$)\s*(.*)/) { > $total+=$amount; > } > } > > $Total=$total; > print "total=$total\n"; > print "Total=$Total\n"; > ----------------------------------------------------------------- > > Output from perl-5.001-5: > total=13.5 > Total=13.5000000003576 > > Output from perl-5.001-3: > total=13.5 > Total=13.5000000005364 >
No problem here, OS/2, 486/66x2 (1.5 years old). It would help if you report the version of perl (perl -v) (there is no such guy as 5.001-5), OS, compiler. Run myconfig. Ilya