problem printing contents of file in directory
- From: aloknathlight@xxxxxxxxx (Alok Nath)
- Date: Wed, 27 Jun 2007 23:32:04 -0700 (PDT)
Hi,
Can anybody tell me why its not printing the contents of each
inside a particular folder ?
I lost all my hairs scratching my head.
Thanks
Alok.
my $tstToRunDir = "C:\\perlScripts" ;
my $fileInTstToRunDir ;
opendir TST2RUN, $tstToRunDir || die "Failed to open $tstToRunDir $!\n" ;
open RESULTS_LOG, ">>ResultLog.log" || die "Failed to open log\n" ;
while ($fileInTstToRunDir = readdir (TST2RUN)){
chomp $fileInTstToRunDir ;
#open the file and get connection description and test description
open FILE_2RUN, $fileInTstToRunDir || die " Failed to open $fileInTstToRunDir:$!\n" ;
print "File is : $fileInTstToRunDir\n" ;
next if($fileInTstToRunDir =~ m/^./ ) ;
while( <FILE_2RUN> ){
print $_ ;
if ($_ =~ m/<Test Description/ ){
print $_ ;
}
}
print RESULTS_LOG "File is : $fileInTstToRunDir\n" ;
#$count++ ;
# close FILE_2RUN ;
}
close RESULTS_LOG ;
close TST2RUN ;
____________________________________________________________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
- Follow-Ups:
- Re: problem printing contents of file in directory
- From: John W. Krahn
- Re: problem printing contents of file in directory
- Prev by Date: Re: DBI, postgresql and large table
- Next by Date: Re: problem printing contents of file in directory
- Previous by thread: DBI, postgresql and large table
- Next by thread: Re: problem printing contents of file in directory
- Index(es):