This is really strange.  I have a method that works and returns all the 
values in a file for the cgi object.  But on the second call to the script it opens 
the file and returns none of the cgi parameters.

the $cgi->param( ) returns POSTDATA 
and the keywords( ) returns nothing.
I'm using strict and warnings

sub readpics{
print STDERR "\n readpics ";
  if(-e "./pic_urls.txt"){
  if(open(PICSR, "./pic_urls.txt")){
#  it gets here just fine.
print STDERR "\n exists pic_urls.txt";
     my$pm;{no strict;$pm = new CGI(PICSR);
if($pm){
[EMAIL PROTECTED] = $pm->param( );
[EMAIL PROTECTED] = $pm->keywords( );
print STDERR "\n param @p\n keywords @q";
        for(my$i=0;$i<$numpics;$i++){
           $caps[$i] = "1";$urls[$i] = "1";
           $urls[$i] = $pm->param("url_".$i);
           $caps[$i] = $pm->param("caps_".$i);
            $caps .= "$caps[$i]|";
           $urls .= "$urls[$i]|";
        }
    } close(PICSR);
$caps =~ s/\n//g;$caps =~ [EMAIL PROTECTED]|$@@;$caps = "&caps=$caps";
$urls =~ s/\n//g;$urls =~ [EMAIL PROTECTED]|$@@;$urls = "&urls=$urls";
print STDERR "\n caps = $caps";
push(@pkg::messages, "Read file ./pic_urls.txt");
  }
  }else{push(@pkg::messages, "Couldn't read ./pic_urls.txt,\nError: $!");}
  }
}

any suggestions?

Reply via email to