in reply to Re: Re: Re: Re: Problem with CGI script not working (regex at fault)
in thread Problem with CGI script not working (regex at fault)
There is nothing much here that explains your problem. There are no print statements so I would not expect this bit to print anything. I would worry that the line
Is causing problems. The glob is nice in quick and dirty programs but if the file can not be found there is no error checking. This is much better for debugging:while (<$HTML>)
open FILE, "<$HTML" or die "Oops opening $HTML, Perl says $!\n"; while (FILE) { .... } close FILE;
I would point out that from the security point of view using a user supplied full file name as you do allows the user to open any file on your system that your script has read acess to. Typically you hard code the path and only allow the user to supply the file name thus constraining them to one dir.
$path = "path/to/my/files"; $HTML =$q->param('file'); open FILE "<$path/$HTML" ....
I suggest changing the while structure to use an open and adding a debugging print to see that $_ actually contains what you expect within this loop.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|