Thanks for the quick answer. Works fine now. > -----Original Message----- > From: Gerald Richter [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, March 05, 2002 3:58 PM > To: Jack Knight; [EMAIL PROTECTED] > Subject: Re: File read blocking within embperl doc > > > Hi, > > I guess you should set optRawInput in your EMBPERL_OPTIONS, otherwise > Embperl treats the <REPORT> as html tag instead as a file handle > > Gerald > > ------------------------------------------------------------- > Gerald Richter ecos electronic communication services gmbh > Internetconnect * Webserver/-design/-datenbanken * Consulting > > Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz > E-Mail: [EMAIL PROTECTED] Voice: +49 6133 925131 > WWW: http://www.ecos.de Fax: +49 6133 925152 > ------------------------------------------------------------- > > ----- Original Message ----- > From: "Jack Knight" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, March 05, 2002 4:42 PM > Subject: File read blocking within embperl doc > > > > Hi, > > > > I have a simple index.epl page which I want to read through the files > within > > a directory and extract a comment line which contains a description for > the > > file. However, opening the files is no problem - if I remove the while > read > > loop the code executes, albeit uselessly. Otherwise reading appears to > > block. I've also tried reading single files, which do the same. > Any ideas > > anyone? > > > > Page code: > > --- > > > > <HTML> > > <HEAD> > > <meta name="description" content="Index"> > > <TITLE>Report Index</TITLE> > > </HEAD> > > <BODY> > > [- > > sub GetName { > > my ($ReportName)=@_; > > > > my $ReportDesc=""; > > > > open(REPORT,$ReportName) or die "Cannot open report file $ReportName: > > $!\n"; > > while(<REPORT>) { > > # eg <!-- Report="Test Report" --!> > > if (/<!-- Report/) { > > (undef,$ReportDesc,undef)=split('\"'); > > last; > > } > > } > > close(REPORT); > > return $ReportDesc; > > } > > > > # Main section > > opendir(REPORTDIR, ".") or die "Cannot open report directory: $!"; > > @Reports=grep /\.epl/, readdir REPORTDIR; > > closedir REPORTDIR; > > $Dir=$ENV{'SCRIPT_FILENAME'}; # get full path to this file > > $Dir=~s/\w+\.\w+$//; # rip out this filename to leave > > directory path > > foreach $Rep (grep !/index.epl/,@Reports) { > > push(@Category,$Dir . $Rep); # save for later use > > } > > -] > > [$ foreach $line (@Category) $] > > [+ sprintf("<BR>%s", GetName($line)) +] > > > > [$ endforeach $] > > > > > > </BODY> > > </HTML> > > --- > > > > > ------------------------------------------------------------------ > ---------- > ---- > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
