PerlBeginNew has asked for the wisdom of the Perl Monks concerning the following question:
Hey,
I am a beginner for Perl. Had a basic question. Would appreciate the help.
______________________________________________________
#!/usr/bin/perl # change_directory.pl use warnings; use strict; use Cwd; #list the Timepoint directories my @TP_dir = glob("T*"); print @TP_dir, "\n"; #list the first timepoint directory print $TP_dir[0], "\n"; my $current_dir = getcwd(); print $current_dir; chdir ("$current_dir/$TP_dir[0]") or die "Can't change directory to TP + $!\n"; ________________________________________________________
I am running my perl script in DOS and here is the output:
C:\Documents and Settings\Punita Sharma\Desktop\ExperimentDate>pe tory.pl T1T2 T1 C:/Documents and Settings/Punita Sharma/Desktop/ExperimentDate C:\Documents and Settings\Punita Sharma\Desktop\ExperimentDate>
_________________________________________________
Essentially my problem is that I am not able to get the chdir to work. I'd like to use the mkdir within the T1 and T2 subdirectories.
Thanks
20101027 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: chdir problem
by eyepopslikeamosquito (Archbishop) on Oct 25, 2010 at 10:29 UTC | |
|
Re: chdir problem
by ambrus (Abbot) on Oct 25, 2010 at 10:30 UTC | |
|
Re: chdir problem
by ww (Archbishop) on Oct 25, 2010 at 12:02 UTC | |
|
Re: chdir problem
by choroba (Cardinal) on Oct 25, 2010 at 10:30 UTC | |
|
Re: chdir problem
by Marshall (Canon) on Oct 26, 2010 at 00:19 UTC |