my $indir = ; # $indir = "directory\r\n"; # binmode stops the \r\n -> \n translation chomp $indir; # chomp removes $/, which is "\n" # the \r is left intact