in reply to chdir not working

The directory probably is changing, but you are printing a stale value. You did not change the value of the $cwd scalar variable between print's. If you are using Cwd, try this:

print "CWD:$cwd"; my $path_data = $cwd."\\data";//Also want to make the concat in-casese +nsitive chdir($path_data) or die "Cant chdir to $path_data $!"; $cwd = getcwd(); print "\nCWD:$cwd"; #//same directory as above gets printed

Replies are listed 'Best First'.
Re^2: chdir not working
by Anonymous Monk on Mar 14, 2011 at 21:53 UTC

    Actually I want to go one level back and then append data like below,but seems like the syntax is not right,it nots going one level up.Can you advise how can I do that? Cant chdir to E:/qdepot_automation/files\\data No such file or directory at perl.pl line 157

    print "CWD:$cwd"; my $path_data = $cwd."..\\\\data";//Also want to make the concat in-ca +sese +nsitive chdir($path_data) or die "Cant chdir to $path_data $!"; $cwd = getcwd(); print "\nCWD:$cwd"; #//same directory as above gets printed