opendir problem

Tom Keller kellert at ohsu.edu
Thu Jun 6 18:54:12 CDT 2002


Greetings,
I always seem to have trouble with I/O ...grrrrr.
When I run the following program (code snippet follows #####) I get 
the following:
  kellert% ~/bin/move_seq.pl
Enter the parent directory for your input data directories: 
/Volumes/Core\ Lab/Vibrio/
Enter the parent directory for output of text files: /Volumes/Core\ 
Lab/Vibrio/current_vibrio.seq
Can't open parent directory /Volumes/Core\ Lab/Vibrio/: No such file 
or directory at /Users/kellert/bin/move_seq.pl line 25, <STDIN> line 
2.

I'm stumped. Why doesn't opendir work with $parent??

###### code snippet ##########
print "Enter the parent directory for your input data directories: ";
my $parent = <STDIN>;
chomp $parent;

print "Enter the parent directory for output of text files: ";
my $out_dir = <STDIN>;
chomp $out_dir;
mkdir $out_dir unless -e $out_dir && -d _;    ## check to see if 
exists, if not, make the directory

chdir $parent;	#change to input directory
my (@all_text);
opendir (DIR, $parent) or die "Can't open parent directory $parent: $!";
print "Parent_dir is $parent\n";	## sanity check
#########
The program dies at this point with "Can't open parent directory 
/Volumes/Core\ Lab/Vibrio/: No such file or directory at 
/Users/kellert/bin/move_seq.pl line 25, <STDIN> line 2."
Any suggestions?
Thanks,
Tom K.
-- 
Thomas J. Keller, Ph.D.
MMI Research Core Facility
Oregon Health & Science University
3181 SW Sam Jackson Park Rd
Portland, Oregon  97201
TIMTOWTDI



More information about the Pdx-pm-list mailing list