[17892] in Perl-Users-Digest
Perl-Users Digest, Issue: 52 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 12 18:10:41 2001
Date: Fri, 12 Jan 2001 15:10:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979341017-v10-i52@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 12 Jan 2001 Volume: 10 Number: 52
Today's topics:
Re: Search scipt <stevec@ntlworld.com>
Switch to Linux wish_was_a_newbie@db-networks.com
Re: Switch to Linux <comdog@panix.com>
Re: Switch to Linux (Tad McClellan)
The Perl Conference Call for Participation <gnat@frii.com>
whois script in perl <robin@dominodata.nl>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 12 Jan 2001 22:59:19 -0000
From: "stevec" <stevec@ntlworld.com>
Subject: Re: Search scipt
Message-Id: <HZL76.1946$lz.47157@news6-win.server.ntlworld.com>
Has anyone worked on or knows of a perl (or any other) script that will
search other web sites and compare prices, amalgamate them and list the
different prices on a web page?
Thanks
Stevec
------------------------------
Date: Fri, 12 Jan 2001 19:39:22 GMT
From: wish_was_a_newbie@db-networks.com
Subject: Switch to Linux
Message-Id: <cbnu5t8187tippd2kpj0q3o516k3lgd3i5@4ax.com>
Hi,
I am both a Perl and Linux newbie.
I have some perl scripts that work under Win98. I installed RedHat 6.2
with Perl. Perl "works."
The scripts use LWP::UserAgent. I downloaded:
perl-libwww-perl-5.43-2.i386.rpm.
I used rpm to "install" it. The script still does not compile.
Where can I find the instructions on how to properly install the LWP::
module?
Thanks
------------------------------
Date: Fri, 12 Jan 2001 14:51:44 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Switch to Linux
Message-Id: <comdog-8B3708.14514412012001@news.panix.com>
In article <cbnu5t8187tippd2kpj0q3o516k3lgd3i5@4ax.com>,
wish_was_a_newbie@db-networks.com wrote:
> Where can I find the instructions on how to properly install the LWP::
> module?
if you use the CPAN shell, you don't need the instructions:
perl -MCPAN -e shell
--
brian d foy <comdog@panix.com>
no longer for hire ;)
------------------------------
Date: Fri, 12 Jan 2001 15:08:59 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Switch to Linux
Message-Id: <slrn95up2r.2bt.tadmc@tadmc26.august.net>
wish_was_a_newbie@db-networks.com <wish_was_a_newbie@db-networks.com> wrote:
>
>I am both a Perl and Linux newbie.
You will become severely enriched by learning those :-)
>I have some perl scripts that work under Win98. I installed RedHat 6.2
>with Perl. Perl "works."
>
>The scripts use LWP::UserAgent. I downloaded:
>perl-libwww-perl-5.43-2.i386.rpm.
>
>I used rpm to "install" it. The script still does not compile.
>
>Where can I find the instructions on how to properly install the LWP::
>module?
I avoid RPMs for perl and modules. I build them from source
that I get from CPAN (of course). 99.5% of the time they just
built and worked no problem.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 12 Jan 2001 19:40:55 GMT
From: Nathan Torkington <gnat@frii.com>
Subject: The Perl Conference Call for Participation
Message-Id: <b5J76.899$B9.191673344@news.frii.net>
Keywords: Perl Conference, Call for Papers
Yes folks, it's that time again. I'm sorry this is coming so late, we
had some crossed wires along the lines of "You thought I was going to
post it? I thought *you* were going to post it!" Better late than
never, though.
Because of the communication cockup, I'm going to extend the paper
deadline to Jan 25.
Short summary:
* papers are more academic and technical than talks.
* papers are 25 minutes. Talks can be 25, 40, or 90 minutes.
* give a paper or talk to get free admission to the conference
* paper deadline: Jan 25
* talk/tutorial deadline: Feb 1
* conference is in San Diego, July 23-27.
Any questions, feel free to send me mail.
Nat
-----
O'Reilly Perl Conference 5
Call for Participation
Overview
O'Reilly & Associates is pleased to announce the 5th annual Perl
Conference. This event is the central gathering place for the Perl
community to exchange ideas, techniques, and to advance the
language. The Perl Conference is a four-day event is designed for Perl
programmers and developers and technical staff involved in Perl
technology and its applications. The conference will be held at the
Sheraton San Diego Hotel and Marina, San Diego, California, July
23-27, 2001.
The Perl Conference includes two days of intensely focused tutorials
aimed mainly at intermediate and advanced Perl programmers. These
tutorials are designed to provide concrete knowledge that leads
directly to better Perl programs. Three days of multi-tracked
conference sessions focus on the cutting edge Perl technology and
feature talks, demonstrations, and panel debates on topics ranging
from object-orientation to data mining.
Technically sophisticated individuals who are actively working with
Perl technology make all tutorials and conference presentations.
Presentations by marketing staff or with a marketing focus will not be
accepted.
Participation Opportunities
Individuals and companies interested in making technical presentations
at the Conference are invited to submit proposals to the conference
organizers following the guidelines below. Proposals will be
considered in three classes: tutorial programs, conference
presentations, and refereed papers.
Topics
The program committee invites submissions of tutorials, conference
presentations, or refereed papers on topics of interest to Perl
programmers. Here are some suggested topics:
Perl 6 Perl 5
Internals Threads
The Web I18N/L10N
XML SOAP/XML-RPC/CORBA
LDAP Linking Perl and C/C++/Java
The Compiler Databases
GUIs and Graphics P2P
.NET
Other are welcomed.
Tutorial Presentations
The first two days of the conference are devoted to tutorial presentations.
Tutorial proposals must include:
* Tutorial Title
* Tutorial length (3 or 6 hours)
* Target audience including any prerequisites for taking advantage of
the material (i.e. a basic understanding of Perl is necessary)
* What attendees will learn--the knowledge or skill take-away attendees
will have at the completion of the tutorial
* Tutorial outline--a short bullet list or description of the course
itself and the material it covers
* Speaker name
* Speaker biography
* Complete speaker contact information; if applicable, include
administrative support contact information
Conference Presentations
Conference presentations and participation will be considered for
these types of talks:
* Case studies showing an application of Perl, the problems that were
solved and the lessons learned
* Focused technology discussions covering a specific Perl technology
such as the compiler, and showing a variety of implementation or
application options
* New product/technology demonstrations--live demonstrations of released
or near released Perl modules or applications
* Panel participation--speakers to participate in one of the various
panel discussions that are part of the conference
Conference proposals must include:
* Type of talk--technology, new product, case study, or panel
* Title of talk or demonstration
* Length of talk (25, 40, or 90 minutes)
* Abstract of talk, maximum 250 words
* Speaker name
* Speaker biography
* Complete speaker contact information; if applicable, include
administrative support contact information
Refereed Papers
Individuals or teams interested in submitting technical papers on Perl
programming are invited to submit extended abstracts of their work for
consideration by the committee. All accepted papers will be published
in the proceedings of the Conference.
Extended abstracts should be no shorter than one page and must contain:
* A summary of the work done, which the paper will describe
* Whether the work has been done, is partially done, or is planned to be done
* The author's name, affiliation, and e-mail address
* Bullet-point multi-level outline showing the expected scope and
content of the paper
The committee will consider only new work that has not been presented
or submitted for consideration at other conferences. Accepted papers
authors will receive complete instructions for preparing their
material from the committee.
Submitting Your Proposal
Please send all proposals to:
tpc5-proposals@oreilly.com
Submit all proposals via electronic mail in plain text with no
attachments. Submit one proposal per email. The subject line of your
email must follow this format:
Your Last Name: proposal type (tutorial, proposal, paper):
proposal title
for example
Smith: Tutorial: Advanced Perl Programming
You will receive an automatic confirmation of receipt for each proposal.
Important Dates
Refereed paper abstracts due: January 25, 2001
All other proposals due: February 1, 2001
Notification to paper presenters: February 1, 2001
Notification to conference and tutorial presenters: March 1, 2001
Refereed papers due: March 15, 2001
Tutorial presentations due: May 1, 2001
Conference presentations due: June 1, 2001
------------------------------
Date: Fri, 12 Jan 2001 22:14:17 +0100
From: "robin roos" <robin@dominodata.nl>
Subject: whois script in perl
Message-Id: <93nsh5$d8l$1@ncc1701.cistron.net>
Hi, I have this script running (www.dominodata/nl/cgi-bin/whois.cgi) that
only checks com/net/org .
When I try to make it check domains in the netherlands by declaring domain,
region and lookup url: "nl", "dutch", "whois.domain-registry.nl" it somehow
ignores it. It tried several options like changing &defaulttld in "nl",
declaring "nl" as an american region etc.. It either checks com/net/org or
just nl but doesn't do both. Can someone figure out in this small script how
to make it work for nl as well cause no one in my area is able to solve the
problem!
thanks,robin
THE SCRIPT:
#!/usr/bin/perl
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^#
# #
# _____ _ _ _ _ _ _ __ _ _ #
# | | |___| |_| | | | |_ ___|_|___ | | |_| |_ ___ #
# | | | | -_| _| | | | | . | |_ -| | |__| | _| -_| #
# |_|___|___|_| |_____|_|_|___|_|___| |_____|_|_| |___| #
# #
# #
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^#
# NetWhois Lite v1.0 Copyright 2000 Dale Emmons 6.1.00 #
# All Rights Reserved. #
# #
# You can find more of my stuff at http://dale.emons.com/perl/ #
# #
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^#
# LICENSE AGREEMENT #
# #
# Any and all use of this product, in whole or in part, is subject to #
# and signifies agreement to the terms set forth in the End User License #
# Agreement that is referenced at #
# http://dale.emons.com/perl/netwhois_lite/license.html. For your #
# reference, a copy of the above mentioned license is provided as part #
# of this distribution in a file called LICENSE.TXT. In the event a #
# discrepancy exists between the license contained on our web site and #
# the license accompanying this software, the license contained on our web #
# site shall be deemed authoritative. #
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^#
# INCLUDED FILES #
# #
# whois.cgi This file, the one that holds all of the script that #
# makes everything work. #
# whoistemplate.html Used by whois.cgi to format output. #
# install.txt Holds instructions and other information about this #
# product. #
# license.txt Holds license information. #
# #
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^#
# url of this script
my $scriptLocation = "http://www.dominodata.nl/cgi-bin/whois.cgi";
# location of the template file relative to this script
my $template = "whoistemplate.html";
# page that you want the registration link to go to
my $registerPage = "/register.html";
# in the template file, the string that will be replaced with this script's
output
# note: backslashes must be before the carrot (^) sign here, but are not in
the template file
my $resultsReplaceString = '<\^results\^>';
# font info for the results
my $fontInfo = '<font size="3" face="Verdana, Arial, Helvetica,
sans-serif">';
# when not whois checks are issued to the script (ie, when a visitor first
comes to the
# script, the script will display the following text. Usually along the
lines of
# 'check if your domain is availabel'
my $defaultString = "Check to see if your domain is available!";
# again, when visitor first comes, there will be a default domain already in
the text
# box. usually along the lines of 'your-domain'. Can be left blank.
my $defaultDomain = "your-domain";
# the default top level domain (eg. com, net, org, etc.)
my $defaultTLD = "com";
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^#
# No editing is necessary past this point. #
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^#
use IO::Socket;
use strict;
use CGI;
my @TLDs = ("com" , "american" ,
"net" , "american" ,
"org" , "american" ,
"nl" , "dutch" );
# region domain doesn't exist string test server whois results
server
my @TLDservers = ( "american" , "No match for" , "whois.crsnic.net" ,
"whois.networksolutions.com" ,
"dutch" , "No match for" , "whois.domain-registry.nl" ,
"whois.domain-registry.nl" );
print "Content-type: text/html\n\n";
# setup timeout signal
$SIG{ALRM} = sub {printPage("$fontInfo Operation timed out.</font>")};
printPage(main());
sub main {
# get CGI stuff
my $query = new CGI;
my $domain = $query->param('domain');
my $TLD = $query->param('tld');
my $whoisDomain = $query->param('whois');
if ($whoisDomain) {
($domain, $TLD) = split(/\./, $whoisDomain);
$whoisDomain = 1;
} else {
$whoisDomain = 0;
}
my ($output, $possibleTLD);
# if $domain has a TLD at the end and is valid, use that. otherwise dump
it.
if ($domain =~ /\./isg) {
$possibleTLD = $domain;
$possibleTLD =~ s/^.*\.//isg;
my $i;
for ($i=0;$i<@TLDs;$i+=2) {
if ($TLDs[$i] eq $TLD) {
$TLD = $possibleTLD;
}
}
$domain =~ s/\..*//isg;
}
# don't want a whois or a check (ie: first visit) so trigger printing of
std. page.
my $defaultPage = 0;
if (!$domain) {
$TLD = $defaultTLD;
$domain = $defaultDomain;
$defaultPage = 1;
}
# determins $TLD 's region
my ($i, $TLDRegion);
for ($i=0;$i<@TLDs;$i+=2) {
if ($TLDs[$i] eq $TLD) {
$TLDRegion = $TLDs[$i+1];
}
}
# set server access info based on $TLD's region
my ($TLDsearchString, $TLDtestServer, $TLDwhoisServer);
for ($i=0;$i<@TLDservers;$i+=4) {
if ($TLDservers[$i] eq $TLDRegion) {
$TLDsearchString = $TLDservers[$i+1];
$TLDtestServer = $TLDservers[$i+2];
$TLDwhoisServer = $TLDservers[$i+3];
}
}
# searches all domain/region pairs of @TLDs for ones that match $TLDRegion,
except $TLD,
# and assigns them to @TLDsInRegion
my @otherTLDsInRegion;
for ($i=1;$i<@TLDs;$i+=2) {
if ($TLDs[$i] eq $TLDRegion) {
@otherTLDsInRegion = (@otherTLDsInRegion, $TLDs[$i-1]) unless
($TLDs[$i-1] eq $TLD);
}
}
# if this is a simple whois query, call getWhois() and print the results to
printPage().
if ($whoisDomain) {
return $fontInfo."<BR><BR><font
size=1>".getWhois("$domain.$TLD",$TLDwhoisServer)."</font></font><BR><BR>";
}
# check if domain contains illegal characters, etc. and say so if it is
if (!checkCharacters($domain))
$output = makeForm($domain,$TLD,@otherTLDsInRegion).$fontInfo."<br>The
domain \"$domain.$TLD\" contains illegal charactors.<br>Domains cannot begin
or end with a dash, may only contain a-z, 0-9 and hyphens, and must be 26
characters or less.</font>";
return $output;
# good domain (syntax), let's do the check.
} else {
if ($defaultPage) {
$output = $fontInfo.$defaultString;
}
$output = $output.makeForm($domain,$TLD,@otherTLDsInRegion).$fontInfo;
my $registerIt="";
if ($registerPage) {
$registerIt = "<a href=\"$registerPage\">Click here</a> to register
it!<br>";
}
if (!$defaultPage) {
if (!$TLD)
$output = $output.'Not a valid top level domain. Please go back and try
again.';
return $output;
}
my $also = "also";
if (checkAvailable("$domain.$TLD",$TLDtestServer,$TLDsearchString)) {
$output = $output."\"$domain.$TLD\" is available!<br>$registerIt<br>";
} else {
$output = $output."\"$domain.$TLD\" is not available.<br><font
size=\"1\"><a href=\"$scriptLocation?whois=$domain.$TLD\">Click here to see
it's whois record.</a></font><br><br>";
$also = "";
}
foreach $i (@otherTLDsInRegion) {
if (checkAvailable("$domain.$i",$TLDtestServer,$TLDsearchString)) {
$output = $output."\"$domain.$i\" is $also
available!<br>$registerIt<br>";
}
}
}
$output = $output.'</font>';
return $output;
}
}
# takes info to replace $resultsReplaceString with in $template and prints
it
sub printPage {
my $output = $_[0];
open(TEMPLATE,"$template") or die "Couldn't open template file,
\"$template\": $!";
foreach (<TEMPLATE>) {
my $line = $_;
#replace stuff from each line, as needed.
$line =~ s/($resultsReplaceString)/$output/isg;
print $line;
}
close TEMPLATE;
exit;
}
# creates the search form using the domain and TLD.
sub makeForm {
my ($domain, $TLD, @otherTLDsInRegion) = @_;
my $output = '<form method="get"
action="'.$scriptLocation.'">'.$fontInfo.'www.<input type="text"
name="domain" value="'.$domain.'">.<select name="tld"><option
value="'.$TLD.'" selected>'.$TLD.'</option>';
my $i="";
foreach $i (@otherTLDsInRegion) {
$output = $output.'<option value="'.$i.'">'.$i.'</option>';
}
$output = $output.'</select><input type="submit" name="Go!"
value="Go!"><font size="1"><br><a
href="http://dale.emmons.com/perl/netwhois_lite/">NetWhois Lite
v1.0</a></font></font></form>';
return $output;
}
# connects to a whois database through Net::Whois (or Whois.pm) and checks
if a domain
# is available. if it is: returns 1. if not: 0.
sub checkAvailable {
alarm 10;
my $input = $_[0];
my $TLDtestServer = $_[1];
my $TLDsearchString = $_[2];
# sleep 6;
my $port = "43";
my $next = "\015\012";
my $socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>$TLDtestServer,
PeerPort=>$port,);
unless ($socket) {die $input, $@; }
print $socket "$input" . $next;
my $line;
foreach $line (<$socket>) {
if ($line =~ /$TLDsearchString/) {
alarm 0;
return 1;
}
}
close $socket;
alarm 0;
return 0;
}
# tests string if valid for a domain name. if valid: returns 1; otherwise:
0.
sub checkCharacters {
my $testString = $_[0];
if ($testString > 26) {
return 0;
}
# fails of domain starts or ends with a hyphens
if ($testString =~ /^-/isg || $testString =~ /-$/isg) {
return 0;
}
# otherwise, delete hyphens so \W test will work right with a domain
# that has dashes in the middle somewhere
$testString =~ s/-//isg;
if ($testString =~ /\W/isg || $testString =~ /\_/isg) {
return 0;
} else {
return 1;
}
}
# gets whois information
sub getWhois {
alarm 10;
my $input = $_[0];
my $TLDwhoisServer = $_[1];
my $port = "43";
my $next = "\015\012";
my $socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>$TLDwhoisServer,
PeerPort=>$port,);
unless ($socket) {die $input, $@; }
print $socket "$input" . $next;
my @whoisInfo = <$socket>;
close $socket;
my $return = join("",@whoisInfo);
$return =~ s/\n/<br>/isg;
$return =~ s/\ / /isg;
$return =~ s/\t/ /isg;
alarm 0;
return $return;
}
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 52
*************************************