check the archives.
some people were having a problem with
the entire file being processed as one line
instead of line by line.

cliff rayman
genwax.com

Steven Clark wrote:

>
>
> I open the file needed for reading and then inside the loop whenever the
> first match occurs the loop is for some reason the loop stops??? Now I know
> the code works perfectly since I have run it from a normal script and it
> does exactly what it is supposed to but yet under modperl for some reason
> it stops after the first successful match...
>
> Code in question is this
>
>     unless ($fh = Apache::File->new($file)){
>         print STDERR "Couldn't open $file because: $!\n";
>         return undef;
>     }
>     while( <$fh> ){
>         next if /^#/;           # Skip comments
>         next if /^$/;           # Skip blank lines
>
>         m/(\d+):([0-9,]*):(.*)/;
>         $id = $1;
>         $temp = $2;
>         $name = $3;
>
>         $CAT{$id}{"name"} = $name;
>     }
>     close $fh;
>
>
> Any ideas?
>
> Steve

Reply via email to