Bob

I should have been a little more specific.  I have a perl script which 
extracts the ip address similar to the one you posted a long time ago.  Back 
then I wrote a  bash shell script which used your script to write a web page 
which had my IP address on it.  It was a plain page with the IP.  I now can't 
find the script so I thought I'd write another in Perl.  If I remember right 
to make the html page I did this.

print "Content-type: text/html\n\n";  >Ip_address.html
print "<HTML><HEAD>\n"; >>Ip_address.html
print "<TITLE>Title Test</TITLE>\n"; >>Ip_address.html
print "</HEAD>\n"; >>Ip_address.html
print "<BODY><A HREF=\"http://www.euglug.org";>Euglug</A>\n"; >>Ip_address.html
print "</BODY></HTML>"; >>Ip_address.html

I wasn't sure If I could the same with perl. 

I found a script which extract the IP and e-mail's it to you and another 
which shows which ports are open.  I'm using some parts of both and want to 
store the html file in /home/timothy/html.  I have a web page with all my 
favorite links in that directory.  I'm normally in my browser and it's easier 
to open a link than to open a shell, su, ifconfig.  I think I could have 
gkrellm ppp start the script when I push the button to start my ppp 
connection.

I hope I provided enough information.

Thank you Brian, Micheal and Neil who posted some suggestion.  I think 
everyone headed me down the right path.

Again Thanks
Tim

On Sunday 30 March 2003 12:46 am, you wrote:
> 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.

_______________________________________________
Eug-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug

Reply via email to