Timothy Bolz wrote:
> I'm have a perl script which I want to make a web page and put it
> into a specific directory. And If I wanted to put some of the
> variables into the page how would I do this? I found how to make
> some of it. From what it looks like I would do the below examples.
You (will) have a script that produces HTML. Do you want to run it
once and store the resulting page on the web server, or do you want to
set the script up as a CGI script so it runs every time anyone loads
its URL?
If you just want to run it once (or if you want to run it every 5
minutes from cron), then just use shell I/O redirection to put the
page where you want it. That's the easiest way, I think.
bash$ perl myscript.pl > /var/www/html/mypage.html
If you want a CGI script, that's more involved. Start with the Apache
CGI documentation.
http://httpd.apache.org/docs/howto/cgi.html
> print "Content-type: text/html\n\n";
> print "<HTML><HEAD>\n";
> print "<TITLE>Title Test</TITLE>\n";
> print "</HEAD>\n";
> print "<BODY><A HREF=\"http://www.euglug.org">Euglug</A>\n";
> print "</BODY></HTML>";
This will work.
> print << ENDHTML;
> html code
> ENDHTML
This will work too.
> or
> print << EOM
> html code
> EOM
You're missing a semicolon. Otherwise, it's the same as the previous one.
> Now what if I want the page to called IP&ports.html how do I name it
> that and then put it in a specific directory. I did a shell scripts
> which did this but I lost it, and Perl is different. Would it be
> "EOM >>IP&ports.html" or "ENDHTML >> IP&ports.html"?
First, don't use an ampersand ("&") in a file name or a URL.
Call it IP-and-ports.html (or something).
If you're asking how to write to a file in Perl, that would
be like this.
open MYHANDLE, ">/var/www/html/IP-and-ports.html"
or die "IP-and-ports.html: $!";
print MYHANDLE "<HTML><BODY>Testing...</BODY</HTML>\n";
close MYHANDLE;
Note that there's no comma after MYHANDLE on the print statement. But
there is a comma after MYHANDLE on the open. (Don't you just love
Perl?)
> I would like to use TK with Perl to make a pop up window with the same
> information. Any suggestions on how to do this or links to a site which can
> help? I thought about having a script if anyone logs into a shell it would
> pop up a window saying who logged in.
That's a whole 'nother topic.
--
Bob Miller K<bob>
kbobsoft software consulting
http://kbobsoft.com [EMAIL PROTECTED]
_______________________________________________
Eug-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug