$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"; }