From sporter at rit.net Thu Feb 4 16:33:37 1999 From: sporter at rit.net (Shawn Porter) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Net::Ping In-Reply-To: <199901292349.XAA26214@shell.servtech.com> Message-ID: Has anybody else ever used Net::Ping. I was using it the other day and it wasn't working according to its documentation. Here's a snippet: use Net::Ping; my $p = Net::Ping->new(tcp, 50); my $resp = $p->ping($hostname); When I do this, I get a '0' in $resp if I can contact the host and a '' (null) if I can't contact the host. (Changing the timeout doesn't affect it.) According to the docs, I should get a '1' if it is reachable, a '0' if it is not, and '' (null) if "the hostname cannot be found or there is a problem with the IP number." No matter what I do, it never returns a '1'. (Perl 5.004_04 tested on Linux 2.0.36 and Digital OSF1 V4.0.) Any ideas? -- Shawn Porter http://www.rit.net/sporter sporter@rit.net From bmathis at directedge.com Wed Feb 10 00:09:06 1999 From: bmathis at directedge.com (Brian Mathis) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Net::Ping References: Message-ID: <36C12282.3438A9CC@directedge.com> Well, I finally got a chance to look at this. Sorry it took so long :). Anyway, terminology is very important. "If the hostname cannot be found, or there is a problem with the IP number, undef is returned." Don't get "undef" confused with "null", they are very different. A variable that is null actually exists but contains a null value. A variable that is not defined, or "undef", simply doesn't exist at all. (Similar to having an empty bucket, or having no bucket at all) I suspect that the code is actually working properly, but you are not testing the values correctly. Here's my code that seems to work: use Net::Ping; my $p = Net::Ping->new('tcp', 50); my $resp = $p->ping( $ARGV[0] ); if( defined $resp ) { print "ok\n"; } else { print "not ok\n"; } Note that checking for "defined" is different from doing a if($var == '') { } However, I also get a 0 returned as the value, even when the host is reachable. I don't know why this is. It seems sufficient to check if the variable is defined or not. It's late and I can't think about this anymore right now.. I'll see what other people have to say tomorrow. Brian --------------------------------------------------- Shawn Porter wrote: > > Has anybody else ever used Net::Ping. I was using it the other day and it > wasn't working according to its documentation. > > Here's a snippet: > > use Net::Ping; > my $p = Net::Ping->new(tcp, 50); > my $resp = $p->ping($hostname); > > When I do this, I get a '0' in $resp if I can contact the host and a '' > (null) if I can't contact the host. (Changing the timeout doesn't affect > it.) According to the docs, I should get a '1' if it is reachable, a '0' > if it is not, and '' (null) if "the hostname cannot be found or there is a > problem with the IP number." No matter what I do, it never returns a '1'. > > (Perl 5.004_04 tested on Linux 2.0.36 and Digital OSF1 V4.0.) > > Any ideas? > > -- > Shawn Porter > http://www.rit.net/sporter > sporter@rit.net From dts7209 at rit.edu Mon Feb 15 18:04:30 1999 From: dts7209 at rit.edu (David Simcik) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Perl Webpage Publishing Systems Message-ID: <36C8B60E.DB4364C0@rit.edu> Greetings! This is going to drive me crazy! I found a site about a month ago that had a tutorial that dealt with this very topic...but naturally I can't find it anymore! I think it was one of those Web developer sites like Devnet, Webmonkey etc.-I checked them, but I still can't find it. Here's an excerpt from O'Reilly's Learning Perl pg. 205-it's a pretty good description of what I'm looking for: "Perl is great for creating custom publishing systems tailored to your unique needs. It's easy to convert raw data into zillions of HTML pages en masse. Sites all over the Web use Perl to generate and maintain their entire website." It goes on to say how The Perl Journal (ww.tpj.com) and perl.com use this sort of system to generate thousands of pages. Any help greatly appreciated. Dave From bmathis at directedge.com Mon Feb 15 19:02:57 1999 From: bmathis at directedge.com (Brian Mathis) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Perl Webpage Publishing Systems References: <36C8B60E.DB4364C0@rit.edu> Message-ID: <36C8C3C1.180C0DE2@directedge.com> I'd be glad to help, but I'm not sure what your question is. Please be more specific. What are you trying to do? Your topic covers a braod range, try to narrow it down a little.. Brian Mathis David Simcik wrote: > > Greetings! > This is going to drive me crazy! I found a site about a month ago > that had a tutorial that dealt with this very topic...but naturally I > can't find it anymore! I think it was one of those Web developer sites > like Devnet, Webmonkey etc.-I checked them, but I still can't find it. > Here's an excerpt from O'Reilly's Learning Perl pg. 205-it's a pretty > good description of what I'm looking for: > > "Perl is great for creating custom publishing systems tailored to your > unique needs. It's easy to convert raw data into zillions of HTML pages > en masse. Sites all over the Web use Perl to generate and maintain their > entire website." > > It goes on to say how The Perl Journal (ww.tpj.com) and perl.com use > this sort of system to generate thousands of pages. > > Any help greatly appreciated. > Dave From dts7209 at rit.edu Mon Feb 15 20:11:15 1999 From: dts7209 at rit.edu (David Simcik) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Perl Webpage Publishing Systems References: <36C8B60E.DB4364C0@rit.edu> <36C8C3C1.180C0DE2@directedge.com> Message-ID: <36C8D3C3.813B5FDD@rit.edu> Hmmmm...this may not help to clarify and will sound a bit rudimentary, but here goes. If you look at any "big" portal site say, CNET or ZDNET, you'll notice that their URL's have Perl parameters in them, even though though they are not passing form data. In essence, this is how they manage their archive of thousands of articles at their sites. I can only assume this type of script would be placed under the category of "document management" or "document publishing". Maybe it's just a template built in Perl that they use to maintain consistency? Here's an example from Webmonkey: http://www.hotwired.com/webmonkey/perl/?tw=perl And CNET: http://www.cnet.com/Content/Gadgets/Special/DigitalTV/?st.cn.fd.gen.gp But then again, here's an example URL from DevHead (doesn't look like a parameter, but what does it all mean???): http://www.zdnet.com/devhead/stories/articles/0,4413,1600169,00.html I hope that helps to clarify a little. I think what I'm going for here is some sort of document management automation. I think I also just confused the hell out of lot of people! Thanks again. Dave Brian Mathis wrote: > I'd be glad to help, but I'm not sure what your question is. Please be > more specific. What are you trying to do? Your topic covers a braod > range, try to narrow it down a little.. > > Brian Mathis > > David Simcik wrote: > > > > Greetings! > > This is going to drive me crazy! I found a site about a month ago > > that had a tutorial that dealt with this very topic...but naturally I > > can't find it anymore! I think it was one of those Web developer sites > > like Devnet, Webmonkey etc.-I checked them, but I still can't find it. > > Here's an excerpt from O'Reilly's Learning Perl pg. 205-it's a pretty > > good description of what I'm looking for: > > > > "Perl is great for creating custom publishing systems tailored to your > > unique needs. It's easy to convert raw data into zillions of HTML pages > > en masse. Sites all over the Web use Perl to generate and maintain their > > entire website." > > > > It goes on to say how The Perl Journal (ww.tpj.com) and perl.com use > > this sort of system to generate thousands of pages. > > > > Any help greatly appreciated. > > Dave From bmathis at directedge.com Mon Feb 15 21:12:32 1999 From: bmathis at directedge.com (Brian Mathis) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Perl Webpage Publishing Systems References: <36C8B60E.DB4364C0@rit.edu> <36C8C3C1.180C0DE2@directedge.com> <36C8D3C3.813B5FDD@rit.edu> Message-ID: <36C8E220.A17C0BA0@directedge.com> Well, there's a few things going on here, let me try to separate them. First, the "perl" parameters you mention, are actually CGI parameters. Don't confuse the two. Perl is a programming language. CGI defines an interface from the web to your program. A program that uses CGI can be written in any language, like Perl, C, Java, etc. The CGI parameters that you see in the URL, are actually part of the specification, and show up as "pathinfo". Any type of program that reads pathinfo can use it. This is actually considered a type of form data. The next part, is what happens on the server side. You probably have heard of "virtual directories". These are directories that are set up in the web server, which, when accessed by, for example http://localhost/directory, actually bring up a directory located somewhere else, say /data/documents. Well, this also works for server-side plugins. You can define a specific virtual directory to actually execute a program (CGI) or send info through a particular handler in the server. You can use the pathinfo to pass additional information to the program. This brings us to what many of these sites do. There are packages out there, one of them is called "storyboard", I believe, which is set up to run like this virtual directory / program. Storyboard also provides and interface to a database, where most of the articles, images, etc.. are stored. It puts everything together into predefined templates, then serves out an html page for you to view. The pathinfo provides the information to storyboard as to which article to show you. Most of these types of sites probably use a commercial system such as storyboard to serve their sites. Also, most of them probably aren't written in Perl, as they need to handle many more requests. It is, of course, possible, and also relatively simple, to write a system like this in Perl. Document management is something that is sorely needed on the web, not only for large sites, but also for the smaller ones. I hope this helps clear things up. Brian Mathis From sporter at rit.net Mon Feb 15 20:27:22 1999 From: sporter at rit.net (Shawn Porter) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Re: Perl Webpage Publishing Systems In-Reply-To: <36C8D3C3.813B5FDD@rit.edu> Message-ID: On Mon, 15 Feb 1999, David Simcik wrote: > Hmmmm...this may not help to clarify and will sound a bit rudimentary, but > here goes. If you look at any "big" portal site say, CNET or ZDNET, you'll > notice that their URL's have Perl parameters in them, Dave, I think you may be confusing Perl with CGI. The stuff after the ? in a URL is used to send data to a program running on the webserver. That program isn't necessarily written in Perl. > even though though they > are not passing form data. There are two types of CGI requests: GET and POST. With a GET, all the info is encoded into the URL. Both a GET and POST can be created w/o using a form. > In essence, this is how they manage their archive > of thousands of articles > at their sites. I can only assume this type of script would be placed under > the category of "document management" or "document publishing". Maybe it's > just a template built in Perl that they use to maintain consistency? I doubt they do all this in Perl. My guess is that they have some other document management system written in C or C++ or something. Anybody else know how they run this? > Here's an example from Webmonkey: > http://www.hotwired.com/webmonkey/perl/?tw=perl > > And CNET: > http://www.cnet.com/Content/Gadgets/Special/DigitalTV/?st.cn.fd.gen.gp > > But then again, here's an example URL from DevHead (doesn't look like a > parameter, but what does it all mean???): > http://www.zdnet.com/devhead/stories/articles/0,4413,1600169,00.html > > I hope that helps to clarify a little. I think what I'm going for here is some > sort of document management automation. I think I also just confused the hell > out of lot of people! > > Thanks again. > Dave You may want to check out PHP or something like that. If you're still running RH Linux, check your dist CD for rpms to install mod_php for Apache. I don't know the URL for info on PHP, but I'm sure you can find it. -- Shawn Porter http://www.rit.net/sporter (716) 889-7346 (716) 889-0954 sporter@rit.net From bmathis at directedge.com Mon Feb 15 22:14:46 1999 From: bmathis at directedge.com (Brian Mathis) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Net::Ping References: Message-ID: <36C8F0B6.E4ADEB4E@directedge.com> I finally tracked down the problem with this. Using "tcp" as your ping type requires that the remote host be running the "echo" service (port 7). If it is not running, it cannot make the connection to that port. The host might still be up and pingable via command line ping, but that uses icmp to test availability. I'll bet that using a "udp" style ping, might also have this problem, but you'll have to check on that.. Brian Shawn Porter wrote: > > Has anybody else ever used Net::Ping. I was using it the other day and it > wasn't working according to its documentation. > > Here's a snippet: > > use Net::Ping; > my $p = Net::Ping->new(tcp, 50); > my $resp = $p->ping($hostname); > > When I do this, I get a '0' in $resp if I can contact the host and a '' > (null) if I can't contact the host. (Changing the timeout doesn't affect > it.) According to the docs, I should get a '1' if it is reachable, a '0' > if it is not, and '' (null) if "the hostname cannot be found or there is a > problem with the IP number." No matter what I do, it never returns a '1'. > > (Perl 5.004_04 tested on Linux 2.0.36 and Digital OSF1 V4.0.) > > Any ideas? > > -- > Shawn Porter > http://www.rit.net/sporter > sporter@rit.net From webmaster at rochester.rr.com Tue Feb 16 10:02:40 1999 From: webmaster at rochester.rr.com (Justin C. Sherrill) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Perl Webpage Publishing Systems In-Reply-To: <36C8E220.A17C0BA0@directedge.com> Message-ID: <001701be59c5$c797db40$4e01a8c0@burp.rochester.rr.com> > This brings us to what many of these sites do. There are packages out > there, one of them is called "storyboard", I believe, which is set up to > run like this virtual directory / program. Storyboard also provides and > interface to a database, where most of the articles, images, etc.. are > stored. It puts everything together into predefined templates, then > serves out an html page for you to view. The pathinfo provides the > information to storyboard as to which article to show you. It's probably StoryServer that you are thinking of - it was created, if I recall correctly, to fit the needs of big news organizations like CNN and other items within the Time Warner media empire. (In fact, the company that makes it is still partially owned by TW, I think.) You can identify a site using it because the URLs look something like http://www.site.com/directory/otherdir/1,24,1123,12.html. The numbers are references into an internal database. A similar mechanism is Allaire's Cold Fusion, which is somewhat smaller and therefore more manageable for smaller projects, as far as I know. It has it's own set of bugs and problems, and speed issues, but I don't know exactly how severe it is. .cfm is the common extension for pages using that functionality. Neither are written in Perl. They both also cost a lot more than Perl. Justin C. Sherrill Rochester Road Runner webmaster webmaster@rochester.rr.com "Think slow, type fats." From bmathis at directedge.com Fri Feb 26 04:09:00 1999 From: bmathis at directedge.com (bmathis@directedge.com) Date: Thu Aug 5 00:19:45 2004 Subject: [rochester-pm-list] Possible job opportunity Message-ID: <199902261609.KAA22832@mars.n-i.com> Hello, I've been recently informed about a short term job opportunity. Skills needed: Web, Perl, UNIX, and experience with interfacing Oracle and Perl. Netscape web server would be helpful. This is a 5-7 week project. If anyone is interested, let me know. Brian