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" ); … }
In reply to Re: Have a multiple file in directory and want to manipulate in each files in incremental order. All the file have same value.
by graff
in thread Have a multiple file in directory and want to manipulate in each files in incremental order. All the file have same value.
by hemantjsr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |