I am getting a headache trying to read your post. Please edit your post and change your <end code> to </CODE>.
I fear you do not understand how chdir works in Perl. After calling chdir, you must call getcwd() again to refresh your $current_dir variable. Please run this program and let us know what it prints:
# change_directory.pl use warnings; use strict; use Cwd; my $current_dir = getcwd(); #list the Timepoint directories my @TP_dir = glob("T*"); for my $dir (@TP_dir) { my $fulldir = "$current_dir/$dir"; if (-d $fulldir) { chdir($fulldir) or die "error: chdir '$fulldir': $!"; my $currdir = getcwd(); print "cd worked: currdir is now '$currdir'\n"; } else { print "oops: '$fulldir' is not a dir\n"; } }
In reply to Re: chdir problem
by eyepopslikeamosquito
in thread chdir problem
by PerlBeginNew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |