Either that, or else you'll need to include the directory name with the file name when you try to do anything with the file:my $directory = "/home/e/Doc/AutoMation"; chdir $directory; opendir( DIR, "." ); for my $file ( readdir DIR ) { next unless -f $file; open( my $in_fh, '<', $file ); … }
opendir( DIR, $directory ); for my $file ( readdir DIR ) { next unless -f "$directory/$file"; open( my $in_fh, '<', "$directory/$file" ); … }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Have a multiple file in directory and want to manipulate in each files in incremental order. All the file have same value.
by Laurent_R (Canon) on Dec 23, 2014 at 13:04 UTC | |
|
Re^2: Have a multiple file in directory and want to manipulate in each files in incremental order. All the file have same value.
by hemantjsr (Initiate) on Dec 24, 2014 at 12:45 UTC | |
by graff (Chancellor) on Dec 25, 2014 at 04:17 UTC |