in reply to detecting carraige returns
If the problem is to 'kick' the 'carrige return' while reading a line ? use the func chomp() , that will do the work . Any way before U start download CPAN modules try to look at "man perlre".