From sheff at pobox.com Tue Jun 5 17:43:18 2001 From: sheff at pobox.com (Keith W. Sheffield) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] using digital certificates with LWP + Net::SSL? In-Reply-To: 's message of "Wed, 23 May 2001 18:25:22 -0500 (CDT)" Message-ID: Is it possible to use digital certificates with LWP and Net::SSL? There is a site that I'd like access with a perl script, but it uses a Verisign digital cert for means of client identification. I can do this for other sites with just plain SSL. I had to request a cert from the site and was able to pull it down once the admin ok'ed it. I've been able to export a .p12 file from Netscape 4.x (on Win2K) and use it w/o problems in Netscape 4.x on linux (Mozilla can import it, but has problems when it comes time to use it). Most of the stuff that I've found so far has to do with creating and using certificates with Apache-SSL. Thanks. ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From philarete at mindspring.com Fri Jun 8 20:12:58 2001 From: philarete at mindspring.com (Brock Sides) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] Re: [Golum-nontech] need suggestion on Windoze (programming) In-Reply-To: ; from Tant-R@co.shelby.tn.us on Fri, Jun 08, 2001 at 10:32:19AM -0500 References: Message-ID: <20010608201258.C967@harmless.yellowsnow.org> * Ray Tant [010608 19:43]: > Get Mac of Local Nic: > #!/usr/bin/perl -w > use strict; Since you've used strict, and so are obviously interested in doing the RIGHT THING... > open (MAC, "/sbin/ifconfig |"); open (MAC, "/sbin/ifconfig |") or die $!; If you're using perl < 5.6 you should also close MAC or die; when you're done. The reason for this is, in perl <= 5.5, the return value of a system call to open a pipe would only be false if the fork failed. In 5.6 it will be false if either the fork or the exec fail. [brock@harmless brock]$ perl -v This is perl, version 5.005_03 built for ppc-linux [brock@harmless brock]$ perl -e 'open (PIPE, "|/no/such/program") or die $!' [brock@harmless brock]$ [brock@grunt brock]$ perl -v This is perl, v5.6.0 built for i386-linux [brock@grunt brock]$ 'open (PIPE, "|/no/such/program") or die $!' bash: open (PIPE, "|/no/such/program") or die $!: No such file or directory [brock@grunt brock]$ However, the attempt to close the pipe will return false: [brock@harmless brock]$ perl -e 'open(PIPE, "|/no/such/program"); close PIPE or die $!' Died at -e line 1. Always check the return value of system calls. -- Brock Sides philarete@mindspring.com One OS to rule them all, one OS to find them, One OS to bring them all and in the darkness bind them, In the land of Redmond, where the shadows lie. ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From philarete at mindspring.com Fri Jun 8 20:19:52 2001 From: philarete at mindspring.com (Brock Sides) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] Re: [Golum-nontech] need suggestion on Windoze (programming) In-Reply-To: <20010608201258.C967@harmless.yellowsnow.org>; from philarete@mindspring.com on Fri, Jun 08, 2001 at 08:12:58PM -0500 References: <20010608201258.C967@harmless.yellowsnow.org> Message-ID: <20010608201951.A1230@harmless.yellowsnow.org> * Brock Sides [010608 20:16]: Oops, messed up on my cut-n-paste: > [brock@grunt brock]$ perl -v > > This is perl, v5.6.0 built for i386-linux > > [brock@grunt brock]$ 'open (PIPE, "|/no/such/program") or die $!' > bash: open (PIPE, "|/no/such/program") or die $!: No such file or > directory That should be: [brock@grunt brock]$ perl -e 'open (PIPE, "|/no/such/program") or die $!' No such file or directory at -e line 1. -- Brock Sides philarete@mindspring.com One OS to rule them all, one OS to find them, One OS to bring them all and in the darkness bind them, In the land of Redmond, where the shadows lie. ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From philarete at mindspring.com Sun Jun 17 17:27:55 2001 From: philarete at mindspring.com (Brock Sides) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] Re: [GOLUM] How do I...? In-Reply-To: <01061720243600.01390@localhost.localdomain>; from jlboers@localhost.localdomain on Sun, Jun 17, 2001 at 08:24:36PM +0000 References: <01061720243600.01390@localhost.localdomain> Message-ID: <20010617172755.A7357@harmless.yellowsnow.org> * jlboers [010617 17:05]: > I want to make a index file called index.html > I have a directory full of pictures in various formats, but mostly jpeg. > i want to make a cd with all the pictures, but want to be able to browse them > via this index.html file. > > i know that there is a way this can be scripted to read a directory's > contents and output it to a text file. > > Does anyone have an idea on how to do this? TMTOWTDI, of course. Here's a way to do it in bash: #!/bin/bash cat >index.html <

My Pictures

FIN for i in *.jpg *.png *.gif ; do echo "$i
" >>index.html done cat >>index.html < FIN And here's one way to do it in perl: #!/usr/bin/perl -w open(FH, ">index.html") or die $!; print FH <

My Pictures

FIN opendir(DH, '.') or die $!; while ($_ = readdir DH) { if (m/\.jpg/ or m/\.png/ or m/\.gif/) { print FH "$_
\n"; } } print FH < FIN __END__ Adjust the html to suit your needs. -- Brock Sides philarete@mindspring.com One OS to rule them all, one OS to find them, One OS to bring them all and in the darkness bind them, In the land of Redmond, where the shadows lie. ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From philarete at mindspring.com Mon Jun 18 20:30:34 2001 From: philarete at mindspring.com (Brock Sides) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] Re: [GOLUM] How do I...? In-Reply-To: <3B2D836D.7040708@boers.cc>; from jl@boers.cc on Mon, Jun 18, 2001 at 04:28:29AM +0000 References: <3B2D836D.7040708@boers.cc> Message-ID: <20010618203033.A957@harmless.yellowsnow.org> * J-L Boers [010618 06:49]: > Thanks Brock, > > I made use of the perl script as you wrote it. It worked beautifully. I > did a mkisofs of the directory afterwards and burned a cd. the cd works > great under Linux and Windows. the navigation part is a little awkward > as the html file did not come out in alphabetical order. (i really don't > know how it sorted itself, creation date maybe???) > but that's a minor detail. Great script! Oh, you wanted the output sorted? :) Try this (in bash): #!/bin/bash cat >index.html <

My Pictures

FIN for i in `ls *.jpg *.png *.gif | sort` ; do echo "$i
" >>index.html done cat >>index.html < FIN Or in Perl: #!/usr/bin/perl -w open(FH, ">index.html") or die $!; print FH <

My Pictures

FIN opendir(DH, '.') or die $!; print FH map "$_\n", sort grep /\.(jpg|gif|png)/, readdir DH; print FH < FIN __END__ This will sort asciibetically, which may not be what you're looking for. To sort alphabetically, use this magic incantation instead: print FH map "$_\n", sort {uc $a cmp uc $b} grep /\.(jpg|gif|png)/, readdir DH; (To sort alphabetically in the bash script, use "sort -f" instead of just "sort".) This might be a good time to introduce the lispiest of perl functions, map and grep. grep, like the unix command, takes a list and creates another list, by selecting elements that fit a certain condition. However, in perl this condition need not be a regex to match, but can be any condition. E.g., I can select the even numbers from 1 to 100 like this: @evens = grep {$_ % 2 = 0} 1..100; map is similar, but rather than selecting elements from the list that fit a condition, it creates new elements. E.g. here's a way to generate the first 100 squares: @squares = map {$_ ** 2} 1..100; > BTW.... What does "TMTOWTDI, of course" stand for. That's the Perl motto: There's more than one way to do it. -- Brock Sides philarete@mindspring.com One OS to rule them all, one OS to find them, One OS to bring them all and in the darkness bind them, In the land of Redmond, where the shadows lie. ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From jl at boers.cc Mon Jun 18 20:42:19 2001 From: jl at boers.cc (J-L Boers) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] RE: [GOLUM] How do I...? In-Reply-To: <20010618203033.A957@harmless.yellowsnow.org> Message-ID: I'll try that again when I get the chance. What's a good "perl for dummies" type book to get? I may want to play around a little more in depth with it. I think a step-by-step approach teaching the command structure (or whatever you call it) would be a good way to start. Any suggestions? -----Original Message----- From: golum-admin@golum.org [mailto:golum-admin@golum.org]On Behalf Of Brock Sides Sent: Monday, June 18, 2001 8:31 PM To: golum@golum.org; memphis-pm-list@pm.org Subject: Re: [GOLUM] How do I...? * J-L Boers [010618 06:49]: > Thanks Brock, > > I made use of the perl script as you wrote it. It worked beautifully. I > did a mkisofs of the directory afterwards and burned a cd. the cd works > great under Linux and Windows. the navigation part is a little awkward > as the html file did not come out in alphabetical order. (i really don't > know how it sorted itself, creation date maybe???) > but that's a minor detail. Great script! Oh, you wanted the output sorted? :) Try this (in bash): #!/bin/bash cat >index.html <

My Pictures

FIN for i in `ls *.jpg *.png *.gif | sort` ; do echo "$i
" >>index.html done cat >>index.html < FIN Or in Perl: #!/usr/bin/perl -w open(FH, ">index.html") or die $!; print FH <

My Pictures

FIN opendir(DH, '.') or die $!; print FH map "$_\n", sort grep /\.(jpg|gif|png)/, readdir DH; print FH < FIN __END__ This will sort asciibetically, which may not be what you're looking for. To sort alphabetically, use this magic incantation instead: print FH map "$_\n", sort {uc $a cmp uc $b} grep /\.(jpg|gif|png)/, readdir DH; (To sort alphabetically in the bash script, use "sort -f" instead of just "sort".) This might be a good time to introduce the lispiest of perl functions, map and grep. grep, like the unix command, takes a list and creates another list, by selecting elements that fit a certain condition. However, in perl this condition need not be a regex to match, but can be any condition. E.g., I can select the even numbers from 1 to 100 like this: @evens = grep {$_ % 2 = 0} 1..100; map is similar, but rather than selecting elements from the list that fit a condition, it creates new elements. E.g. here's a way to generate the first 100 squares: @squares = map {$_ ** 2} 1..100; > BTW.... What does "TMTOWTDI, of course" stand for. That's the Perl motto: There's more than one way to do it. -- Brock Sides philarete@mindspring.com One OS to rule them all, one OS to find them, One OS to bring them all and in the darkness bind them, In the land of Redmond, where the shadows lie. _______________________________________________ Golum mailing list Golum@golum.org http://lists.golum.org/mailman/listinfo/golum ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From philarete at mindspring.com Mon Jun 18 20:48:09 2001 From: philarete at mindspring.com (Brock Sides) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] Re: [GOLUM] How do I...? In-Reply-To: ; from jl@boers.cc on Mon, Jun 18, 2001 at 08:42:19PM -0500 References: <20010618203033.A957@harmless.yellowsnow.org> Message-ID: <20010618204809.D957@harmless.yellowsnow.org> * J-L Boers [010618 20:43]: > I'll try that again when I get the chance. > > What's a good "perl for dummies" type book to get? I may want to play around > a little more in depth with it. I think a step-by-step approach teaching the > command structure (or whatever you call it) would be a good way to start. > Any suggestions? Start with the Llama book, "Learning Perl". Then get the Perl Cookbook, also published by O'Reilly. The Camel book is a nice reference book, but almost all of its content is in "perldoc". (The perl documentation that comes with perl.) -- Brock Sides philarete@mindspring.com One OS to rule them all, one OS to find them, One OS to bring them all and in the darkness bind them, In the land of Redmond, where the shadows lie. ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From sheff at pobox.com Mon Jun 18 20:51:56 2001 From: sheff at pobox.com (Keith W. Sheffield) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] RE: [GOLUM] How do I...? In-Reply-To: "J-L Boers"'s message of "Mon, 18 Jun 2001 20:42:19 -0500" References: Message-ID: >>>>> "J-L" == J-L Boers writes: > I'll try that again when I get the chance. > What's a good "perl for dummies" type book to get? I may want to play around > a little more in depth with it. I think a step-by-step approach teaching the > command structure (or whatever you call it) would be a good way to start. > Any suggestions? I'd suggest 'Learning Perl' by Randal Schwartz and Tom Christiansen aka 'The Llama Book' ISBN 1-56592-284-0. ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From alaricravenhall at hotmail.com Mon Jun 25 22:32:54 2001 From: alaricravenhall at hotmail.com (Alaric Ravenhall) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] redirecting a localhost web server through cgi Message-ID: I have an interesting need: Because of a firewall situation, I need to develop a cgi perl script that will allow me to access it via a web browser and have the perl send the requests via localhost to a local web server. BROWSER ---> PERL MAGIC CGI ----> WEBSERVER BROWSER <--- PERL MAGIC CGI <---- WEBSERVER This will allow the webserver to return data on whatever port you queried from (i.e. port 80) inside your firewall. It sucks haveing a webserver on a non-standard port, but oh, well. Thanks in advance, Nathan Waddell _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From dysan_2000 at hotmail.com Tue Jun 26 08:25:29 2001 From: dysan_2000 at hotmail.com (Big Ed) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] redirecting a localhost web server through cgi Message-ID: You have a firewall in front of your webserver and you need to be able to see the webserver through the firewall? If that's the case, no perl scripts are going to help you. You need to set up a Port Forward from your firewall to your webserver. What kind of firewall is it? Ed >From: "Alaric Ravenhall" >Reply-To: memphis-pm-list@pm.org >To: memphis-pm-list@pm.org >Subject: [Memphis.pm] redirecting a localhost web server through cgi >Date: Mon, 25 Jun 2001 22:32:54 -0500 > >I have an interesting need: >Because of a firewall situation, I need to develop a cgi perl script that >will allow me to access it via a web browser and have the perl send the >requests via localhost to a local web server. > >BROWSER ---> PERL MAGIC CGI ----> WEBSERVER >BROWSER <--- PERL MAGIC CGI <---- WEBSERVER > >This will allow the webserver to return data on whatever port you queried >from (i.e. port 80) inside your firewall. It sucks haveing a webserver on a >non-standard port, but oh, well. > >Thanks in advance, >Nathan Waddell >_________________________________________________________________ >Get your FREE download of MSN Explorer at http://explorer.msn.com > >---------------------------------------------------------------------------- >To unsubscribe, please send email to majordomo@pm.org >with 'unsubscribe memphis-pm-list' in the body of the message. >---------------------------------------------------------------------------- > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From alaricravenhall at hotmail.com Tue Jun 26 12:33:40 2001 From: alaricravenhall at hotmail.com (Alaric Ravenhall) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] redirecting a localhost web server through cgi Message-ID: No I don't have a firewall in front of the web server. I cannot view my webserver from my work because my work's firewall filters out non-standard ports. I f I have cgi script that pulls pages from a server on the same machine as the CGI, then return it to the browser that requested the page from the CGI, I know that will work. Nathan _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From sml at zfx.com Tue Jun 26 13:04:17 2001 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] redirecting a localhost web server through cgi References: Message-ID: <3B38CEA1.B31F6FDC@zfx.com> Alaric Ravenhall wrote: > > No I don't have a firewall in front of the web server. > I cannot view my webserver from my work because my work's firewall filters > out non-standard ports. > I f I have cgi script that pulls pages from a server on the same machine as > the CGI, then return it to the browser that requested the page from the CGI, > I know that will work. use LWP::UserAgent and CGI. read the request with CGI, then turn it into something that LWP::UserAgent can use -- CGI probably has a method for doing that without having to reconstruct the request "by hand". make the request with LWP::UserAgent. check the response status, and return/print the response content. there may be a module that lets you do all this in a one- or two-liner, maybe LWP::UA::Proxy. search CPAN for HTTP and Proxy. if you've got mod_perl, it's probably trivial... get Apache->request->as_string, change the port, and give that to LWP::UserAgent. i'd like to see a solution if you get one. -- Steve Lane ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From perl at erd3.com Tue Jun 26 14:43:45 2001 From: perl at erd3.com (perl@erd3.com) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] redirecting a localhost web server through cgi In-Reply-To: Message-ID: On Tue, 26 Jun 2001, Alaric Ravenhall wrote: > No I don't have a firewall in front of the web server. > I cannot view my webserver from my work because my work's firewall filters > out non-standard ports. > I f I have cgi script that pulls pages from a server on the same machine as > the CGI, then return it to the browser that requested the page from the CGI, > I know that will work. > Nathan If I understand correctly, you have a web server on say port 8080 running at your house and you need to access it from work but the firewall at work will not allow you to connect to port 8080. Is that correct? You want to have on the machine at home another web server that will listen on port 80 and forward the request to port 8080 the send the reply back on the port 80 connection. I can think of a couple of easier ways to do this. 1) Make the html directory for the server on port 80 be the same as the one on 8080. 2) Upgrade to a 2.4.x kennel and run TUX the kernel http deamon. It will serve up static pages on its own and will forward other request to another port (8080). Reece Dike ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From sheff at pobox.com Tue Jun 26 21:21:49 2001 From: sheff at pobox.com (Keith W. Sheffield) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] redirecting a localhost web server through cgi In-Reply-To: 's message of "Tue, 26 Jun 2001 14:43:45 -0500 (CDT)" References: Message-ID: >>>>> "Reece" == writes: > If I understand correctly, you have a web server on say port 8080 running > at your house and you need to access it from work but the firewall at work > will not allow you to connect to port 8080. Is that correct? > You want to have on the machine at home another web server that will > listen on port 80 and forward the request to port 8080 the send the reply > back on the port 80 connection. I can think of a couple of easier ways to > do this. 1) Make the html directory for the server on port 80 be the same > as the one on 8080. 2) Upgrade to a 2.4.x kennel and run TUX the kernel > http deamon. It will serve up static pages on its own and will forward > other request to another port (8080). Unless his ISP is blocking port 80, I don't see why he'd want to run the server on a non standard port. The only exception to that would be if he's running a JSP server or something similar instead of or in addition to httpd on port 80. But if the ISP is blocking 80, then it's a moot point. ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From alaricravenhall at hotmail.com Wed Jun 27 23:18:03 2001 From: alaricravenhall at hotmail.com (Alaric Ravenhall) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] redirecting a localhost web server through cgi Message-ID: To solve all the mystery, I have written a web server in LPC (Lars Pensche C) which is an OO language used to run MUDs. Virtual text-based roleplaying games. I've implemented an in-game POP server, an in-game SMTP server, an in-game FTP server, and now I'm working on the web bit. However, I cannot (because of the restraints of the game) put the web files in my /html directory on the server. So, I have opened my server on port 3015. The problem is that from my work, I cannot access it. This is because I believe the firewall is blocking the connection. I thus cannot use the additional web server idea (which is a cool idea by the way) and because the web pages are dynamically generated by LPC and my MUD, and because the MUD is rooted in a different directory than my ~/html, I can't place the pages there. No, I'm going to try to write the script with CGI and LWP::UserAgent. Thanks for that suggestion. I'll either get it working or give up ;) Incidentally, another thing I will be working on is telnet-like access through a web browser... I think I will implement some sort of private/public key sets.... I could tie in ssh's keygen somehow, I bet. ;) Nathan _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From alaricravenhall at hotmail.com Wed Jun 27 23:30:25 2001 From: alaricravenhall at hotmail.com (Alaric Ravenhall) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] web madness Message-ID: Wow. LWP::UA with CGI will work quite nicely, I think, after reviewing the CPAN documentation on LWP::UA. Anyone real familiar with use of that module?? I think this'll be fun ;) Nathan _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From sml at zfx.com Thu Jun 28 08:06:38 2001 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] web madness References: Message-ID: <3B3B2BDE.95659EBA@zfx.com> Alaric Ravenhall wrote: > > Wow. > LWP::UA with CGI will work quite nicely, I think, after reviewing the CPAN > documentation on LWP::UA. > Anyone real familiar with use of that module?? i'm very familiar with both. i'll be happy to help, but i want you to try first :). i just thought of someone who has one solution btw... it'll be interesting to compare solutions with his. > I think this'll be fun ;) it will be. -- Steve Lane ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From alaricravenhall at hotmail.com Thu Jun 28 22:26:57 2001 From: alaricravenhall at hotmail.com (Alaric Ravenhall) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] web madness with LWP::UA Message-ID: Well.. here's a start. It can pull the index.html. I'm thinking now, I'll include CGI to pass some variables from the browser, to redefine what I want to GET ;) Nathan #!/bin/perl use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => 'http://kracked.com:3015'); $req->header(Accept => 'text/html'); # Ask for page and capture response my $res = $ua->request($req); # did it work? if ($res->is_success) { print $res->content; # for instance } else { print "Error: " . $res->status_line . "\n"; } _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ---------------------------------------------------------------------------- From jgreer at midsouth.rr.com Sat Jun 30 09:09:43 2001 From: jgreer at midsouth.rr.com (Jim Greer) Date: Thu Aug 5 00:07:17 2004 Subject: [Memphis.pm] web madness In-Reply-To: Message-ID: <20010630090943.A27031@midsouth.rr.com> * Alaric Ravenhall (alaricravenhall@hotmail.com) [010627 23:35]: > Wow. > LWP::UA with CGI will work quite nicely, I think, after reviewing the CPAN > documentation on LWP::UA. > Anyone real familiar with use of that module?? Yes, though my example code is at work. I'll send a reminder note to myself to forward you and example on Monday. Jim G -- Of course you have a purpose -- to find a purpose. Jim Greer (Jim ) [expires: 2002-12-09] 5CE1 6822 5E85 38D5 0C5C 8FA8 9499 8A2C 3E8B A74F ---------------------------------------------------------------------------- To unsubscribe, please send email to majordomo@pm.org with 'unsubscribe memphis-pm-list' in the body of the message. ----------------------------------------------------------------------------