in reply to problem in splitting the line

Hi,

If your input is a fixed field record, then unpack function could really make you smile :-) like so:

#!/usr/bin/perl use warnings; use strict; my $str = 'HWI-1KL120:99:C0C9MACXX:6:1101:2105:2123 0 chr5 75483987 0 82M3I16M + * 0 0'; my ( $fifth, $sixth ) = unpack "x31A4xA4", $str; print $fifth, ":", $sixth, $/; # prints 2105:2123 #or even better my ($str_wanted) = unpack "x31A9", $str; print $str_wanted, $/; # prints 2105:2123