use strict; use warnings; use Test::More tests => 1; my @have = ( '99~Arun~Kumar~Mobilenum: 1234-567 , from Earth Human', '98~Mahesh~Babu~Mobilenum: 5678-901 , from Earth Human' ); my @want = ( '99~Arun~Kumar~Mobilenum: 1234-567 , from Earth Human', '98~Mahesh~Babu~Mobilenum: 5678-901 , from Earth Human' ); for (@have) { s/\n/ /sg; } is_deeply (\@have, \@want);