use Data::Dumper; local $Data::Dumper::Useqq = 1; # will also show you \r, \n and other things print Dumper $string;