my $path = '/tmp/foo'; $ex1 = '\tmp\foo\bar'; # is OK $ex2 = '\tmp\foo'; # is OK $ex3 = '\tmp\foo\'; # is OK $ex4 = '\tmp\food'; # is NOT OK