On Thu, 18 Oct 2001, dan radom wrote:
> I'm trying to print the contents of a file which is being passed from
> a html form. I'm pretty close (I think). Here's what I have...
>
> #!/usr/local/bin/perl -w
You should also have 'use strict' here.
> use CGI qw(:all);
> $s=CGI::param('host');
> $s = quotemeta($s);
> print header;
> print start_html();
> open(CONF, "/opt/disk4/REDBACK-BACKUP/$s") or
> die("configuration file not found")";
-------^
You have an extra quote here
This is why you are getting unterminated string errors.
> @t=<CONF>;
Grabbing up a file into an array isn't always a good idea. You should do:
while(<CONF>) {
print "$_<BR>";
}
> close(CONF);
> foreach (@t) { print "$_<BR>" };
> print end_html();
-- Brett
http://www.chapelperilous.net/
------------------------------------------------------------------------
This is clearly another case of too many mad scientists, and not enough
hunchbacks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]