# ok my $path = "dir/file.txt"; # not ok my $path = "dir\file.txt"; # ok my $path = "dir\\file.txt"; # also ok - in single quoted strings only sequences \' and \\ are special my $path = 'dir\file.txt'; #### use File::Spec; my $path = File::Spec->catfile(qw(dir file.txt));