Re: Adding a line in a file inside many directories
- From: tom@xxxxxxxxxxxxxx (Tom Phoenix)
- Date: Fri, 29 Jun 2007 11:32:57 -0700
On 6/28/07, Ved <vedpsingh@xxxxxxxxx> wrote:
open (VEDIN, 'list_of_dir.txt') or die "Cannot open 'File.txt' $!";
Why does the error message mention the wrong file name?
my @rgstr=<VEDIN>;
foreach my $file_list (@rgstr) {
print $file_list ; #printing list of dir
The items in this list haven't been chomped, have they? So each item
ends with a newline.
open (dirIN, '$file_list/kat.s') or die "Cannot open 'File.txt' $!";
#This is not working
If $file_list ends with a newline, I wouldn't expect it to work. Make
sure you're trying to open the correct filename, and make sure that
you mention the correct filename in the error message from die.
Good luck with it!
--Tom Phoenix
Stonehenge Perl Training
.
- References:
- Prev by Date: Re: CPU/Memory usage of a process on Windows machine
- Next by Date: Re: Adding a line in a file inside many directories
- Previous by thread: Adding a line in a file inside many directories
- Next by thread: Need idea for doing automatic iteration, please.
- Index(es):