Thanks very much. I am not able to print the contents of the file. I'll read about glob and the explanation in the perlop. Thank you!
my $dir = 'input_files';
die "can't opendir $!" unless opendir DIR, $dir;
while (defined(my $file = readdir DIR)) {
do {
print "The directory and file are $dir/$file\n";
die "Can't open input file $!" unless open IN, "< $dir/$file";
use File::Glob ();
while (defined($_ = glob(' IN '))) {
print $_;
}
};
}
closedir DIR;
Output
perl create_indivo_schemas.pl
Name "main::IN" used only once: possible typo at create_indivo_schemas
+.pl line 18.
The directory and file are input_files/allergies
INThe directory and file are input_files/immunizations
INThe directory and file are input_files/..
INThe directory and file are input_files/.