[9148] in Perl-Users-Digest
Perl-Users Digest, Issue: 2766 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 30 02:07:24 1998
Date: Fri, 29 May 98 23:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 29 May 1998 Volume: 8 Number: 2766
Today's topics:
Re: "ref($proto) || $proto" considered harmful (was Re: <zenin@bawdycaste.org>
Re: A special message to Bob Hope fans chris+usenet@netmonger.net
Re: A special message to Bob Hope fans chris+usenet@netmonger.net
AOL AIM & perl <noemail@noemail.com>
Re: Certified Webmasters <zenin@bawdycaste.org>
Re: Don't Know how to decrypt using PERL (I R A Aggie)
Re: Don't Know how to decrypt using PERL <lr@hpl.hp.com>
Re: Don't Know how to decrypt using PERL (Mark-Jason Dominus)
Re: Don't Know how to decrypt using PERL (Mark-Jason Dominus)
Re: Don't Know how to decrypt using PERL <lr@hpl.hp.com>
Re: Don't Know how to decrypt using PERL <lr@hpl.hp.com>
Re: expanding a perl variable back to the shell (Fraserwag)
Re: expanding a perl variable back to the shell <carton.lao@shaw.wave.ca>
Re: Have we got a good free Perl manual? <kermit@ticnet.com>
Help with a Socket Problem dwright@thuntek.net
Re: Install: Sorry, but how to install a module? (Mark-Jason Dominus)
perl & AOL AIM <noemail@noemail.com>
PLEASE HELP ME ... I need input on this from as many pe (Michael Dori)
Re: read and write <zenin@bawdycaste.org>
Re: read and write (Ilya Zakharevich)
Re: Reading whole file into a scalar <rootbeer@teleport.com>
Re: seek advice on simple first program (Andre L.)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 May 1998 03:17:18 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: "ref($proto) || $proto" considered harmful (was Re: OO - explicit package name required)
Message-Id: <896498669.90760@thrush.omix.com>
Keith G. Murphy <keithmur@mindspring.com> wrote:
: Mmmm, that's not really what it does. Consider the case where you have
: put some data into $lego.
This depends on how new() is designed, which really isn't any
business of the caller.
: Mmmm, that's not really what it does. Consider the case where you have
: put some data into $lego. But I guess it could depend on how you define
: "cloning". I would *not* say it copies.
No one said it did. "new" normally meens "new".
: Actually, calling it 'new' seems apt: it creates a new instance of
: whatever the thing is. Which could be *extremely* useful;
Yep.
: otherwise,
: you really need new(), instance_new(), *and*
: copy()/assign()/clone()/whatever(). The *worst* thing about it, it
: seems to me, is that if you *depend* on it being defined that way, and
: call it, and it's not, you get something weird. So maybe instance_new()
: *is* the way...
Blagh. Sorry, but blagh. $foo->new() as worked for the few
thousand modules I've built, and I'll keep it until it fails me,
but YMMV of course.
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: 30 May 1998 05:22:45 GMT
From: chris+usenet@netmonger.net
Subject: Re: A special message to Bob Hope fans
Message-Id: <6ko535$js4$1@schenectady.netmonger.net>
In article <kibo-2905981855310001@kibo.std.com>,
James "Kibo" Parry <kibo@world.std.com> wrote:
> > No, the coincidence comes from the KidSpot by Dick Rodgers
>
> Which is an anagram of Rick Dodgers.
>
> ANAGRAMS ARE HARD!!!
Bah! At dinner tonight, the sandblasted-into-the-window "Applebees"
logo made me realize that I want a door in my house with a word etched
into the glass. But I want it to spells another word when viewed from
the other side. And the _same_ word would be too boring (nothing like
wow or tidbit). I was hoping I could find one that was an antonym of
the original word. Then I wrote this perl program to find all such
words:
#!/usr/local/bin/perl -w
use strict;
my %dict;
#print "Loading dictionary...\n";
open DICT, "< /usr/share/dict/words";
while (<DICT>) {
chomp;
$dict{$_}++;
}
close DICT;
#print "Done.\n";
my %out;
while (defined(my $k = each %dict)) {
$k = lc($k);
next if $k =~ /[cefgjknrsz]/;
(my $op = $k) =~ tr/abdhIlmopqTuvwxY/AdbHIlmoqpTuvwxY/;
$op = reverse $op;
next if $k eq $op;
next if length($k) < 2;
$out{$k} = $op if ((exists $dict{$op}) && (!exists $out{$op}));
}
foreach my $k (sort keys %out) {
print "$k -> $out{$k}\n";
}
__END__
I was rather disappointed in the piddling number of words, all of
which are boring, and most of which are stupid:
bib -> did bim -> mid biod -> boid
bit -> tid blo -> old bob -> dod
bow -> wod bub -> dud bum -> mud
da -> Ab dim -> mib dit -> tib
dol -> lob dom -> mob dow -> wob
ido -> obi it -> ti ita -> Ati
la -> Al lit -> til lood -> bool
loom -> mool loot -> tool lot -> tol
lowa -> Awol lwo -> owl mil -> lim
mo -> om mod -> bom mood -> boom
moy -> yom mu -> um muilla -> Allium
my -> ym od -> bo oda -> Abo
oh -> Ho olid -> bilo ow -> wo
tod -> bot told -> blot tom -> mot
toom -> moot toup -> quot tow -> wot
toy -> yot tu -> ut ud -> bu
wold -> blow woy -> yow ya -> Ay
youd -> buoy
"Have you ever solved a stupid word puzzle with Perl, or know someone
who has?"
--
Christopher Masto <chris+usenet@netmonger.net>
Director of Operations, NetMonger Communications, Inc.
"Behold the Power of Cheese"
------------------------------
Date: 30 May 1998 05:36:16 GMT
From: chris+usenet@netmonger.net
Subject: Re: A special message to Bob Hope fans
Message-Id: <6ko5sg$k52$1@schenectady.netmonger.net>
I'm following up to my own post! Woo woo!
In article <6ko535$js4$1@schenectady.netmonger.net>,
<chris+usenet@netmonger.net> wrote:
> Then I wrote this perl program to find all such words:
Of course, that program was full of errors. This one contains
different errors:
#!/usr/local/bin/perl -w
use strict;
my %dict;
#print "Loading dictionary...\n";
open DICT, "< /usr/share/dict/words";
while (<DICT>) {
chomp;
$dict{lc $_}++;
}
close DICT;
#print "Done.\n";
my %out;
while (defined(my $k = each %dict)) {
next if $k =~ /[cefgjkrsz]/;
(my $op = $k) =~ tr/abdhipqty/AdbHIqpTY/;
$op = reverse $op;
next if $k eq lc($op);
next if length($k) < 2;
$out{$k} = $op if ((exists $dict{lc($op)}) && (!exists $out{lc($op)}));
}
foreach my $k (sort keys %out) {
print "$k -> $out{$k}\n";
}
And produces better output:
ab -> dA aba -> AdA abba -> AddA
abo -> odA ad -> bA adad -> bAbA
ah -> HA aht -> THA al -> lA
allay -> YAllA alma -> AmlA alod -> bolA
am -> mA amunam -> mAnumA an -> nA
annam -> mAnnA at -> TA ati -> ITA
avo -> ovA aw -> wA ay -> YA
bab -> dAd bah -> HAd bal -> lAd
bald -> blAd bam -> mAd bat -> TAd
baw -> wAd bay -> YAd bib -> dId
bim -> mId bin -> nId biod -> boId
bit -> TId blo -> old bo -> od
bob -> dod bom -> mod bon -> nod
bot -> Tod bow -> wod bu -> ud
bub -> dud bum -> mud dal -> lAb
dam -> mAb dan -> nAb daw -> wAb
dim -> mIb din -> nIb dit -> TIb
dol -> lob dom -> mob don -> nob
dow -> wob dun -> nub hallan -> nAllAH
haw -> wAH hay -> YAH haya -> AYAH
ho -> oH ido -> obI in -> nI
it -> TI lam -> mAl lamina -> AnImAl
lat -> TAl laud -> buAl lava -> AvAl
lim -> mIl lima -> AmIl lin -> nIl
lina -> AnIl lion -> noIl lit -> TIl
lood -> bool loom -> mool loot -> Tool
lot -> Tol lowa -> Awol lwo -> owl
maba -> AdAm malo -> olAm man -> nAm
mana -> AnAm mao -> oAm mat -> TAm
may -> YAm mho -> oHm min -> nIm
mo -> om moha -> AHom mood -> boom
mot -> Tom moy -> Yom mu -> um
muilla -> AllIum my -> Ym nana -> AnAn
nat -> TAn naw -> wAn nay -> YAn
nit -> TIn no -> on nona -> Anon
not -> Ton now -> won noxa -> Axon
noy -> Yon nu -> un nut -> Tun
oat -> TAo olid -> bIlo ow -> wo
tald -> blAT tana -> AnAT tav -> vAT
taw -> wAT tawa -> AwAT tay -> YAT
told -> bloT toom -> mooT toup -> quoT
tow -> woT toy -> YoT tu -> uT
tuan -> nAuT ulua -> Aulu waup -> quAw
way -> YAw wold -> blow woy -> Yow
yaba -> AdAY yana -> AnAY youd -> buoY
If it isn't obvious, by the way, the capital letters are meant to
indicate that the letter is only symmetrical in its capital form.
Now that I've made a fool of myself in public, I can go home.
--
Christopher Masto <chris+usenet@netmonger.net>
Director of Operations, NetMonger Communications, Inc.
"Behold the Power of Cheese"
------------------------------
Date: Sat, 30 May 1998 12:02:28 +0800
From: "MrMarket.com" <noemail@noemail.com>
Subject: AOL AIM & perl
Message-Id: <356F84D4.625B@noemail.com>
I am looking to send a message to an AOL Instant Messager user from a
perl script. ie., the perl script initiates the message to the AOL
Instant Messanger user. I already know what IP address the AIM user is
at - I just need help in finding out how AIM communicates over the
socket connection. If anyone can help me, I'd be most grateful.
Jean-Yves Sireau
Email : jys @
hk.super.net
------------------------------
Date: 30 May 1998 03:36:09 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Certified Webmasters
Message-Id: <896499799.810661@thrush.omix.com>
Pat Tompkins <ptompkins@iname.com> wrote:
: I am not sure if this is the correct venue to ask this question,
It's not.
: but I am not sure if there is a correct venue for any question...
Hmm...
: That blathering aside. My boss just came back from a convention and he
: was told about an association which is supposed to "certify" web page
: designers.
Yep, I've seen such things.
: He said that if a "certified webmaster", program existed
: for the internet, the company would pay for this certification and he
: could begin to request a for my pay raise. So you can see my interest
: in getting this project moving.
Your boss must have very pointy hair...
For me, anyone that gives raises based on what certifications
or degrees someone has is less then worthless. Will this "Web
Certification" make you any more productive? Very, very unlikely.
: If a certification process exists, I believe it would be good for all.
: No more fly-by-night web site companies popping up out of no where,
: with inexperienced highschool grads working for minimum wage. And I
: think it would lend an air of professionalism to this otherwise
: understood occupation.
Exactly the other way around. Degrees, "certifications", et al
are oftin meaningless. I've seen high school dropouts that can
code circles around people with CS degrees, and far more paper
Novel CNE's then I can count. Any school at any level is a complete
waste of time if you already know what they are teaching.
Personally, when anyone comes to me saying they are "certified" in
anything, it's a BIG red flag that says to me that whatever they
learned for there certification is ALL they know and probably ever
will. I'd rather take the highschool kid on over such a "certified"
person; They probably know more to start with, and are much more
apt to learn more.
Certifications are only good for pointy hair managers. Anyone with
half a clue know they are worth less then the paper they are printed
on.
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: Fri, 29 May 1998 23:07:02 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <fl_aggie-2905982307020001@aggie.coaps.fsu.edu>
In article <6knd03$qj3$1@monet.op.net>, mjd@op.net (Mark-Jason Dominus) wrote:
+ In article <fl_aggie-2905981721540001@aggie.coaps.fsu.edu>,
+ I R A Aggie <fl_aggie@thepentagon.com> wrote:
+ >In which case, they have the on-line documentation for the library
+ >question...again, the problem isn't the documentation so much as
+ >people being unaware or too lazy of how to find the information...
+
+ Hello? Hello? Is this thing on?
+ THE ON-LINE DOCUMENTATION DOES NOT EXPLAIN THE PURPOSE OF THE SALT.
Well, duh. I know that. However...
THE ONLINE DOCUMENTATION I SPEAK OF COVERS THE FINE SYSTEM LIBRARY THAT
CONTAINS THE ROUTINES THE IMPLENTS crypt, NOT THE PERL DOCUMENTATION
THAT GIVES A BRIEF OVERVIEW OF THE *HOOKS* IN PERL TO USE THE UNDERLYING
LIBRARY.
AFAIK, perl does NOT ship with a crypt() library, and is dependent on
the system its installed on to provide a crypt() that it can use.
If, as presumed, the person _has_ crypt(), then the person _should_ have
the documentation covering that library. This documentation is SEPERATE
from the perl documentation.
In unix, one might say 'man 3 crypt'.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Fri, 29 May 1998 21:40:28 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6ko2k6$dh4@hplntx.hpl.hp.com>
Kevin Reid wrote in message
<1d9sv27.104jsyp95jlpmN@slip166-72-108-247.ny.us.ibm.net>...
>Larry Rosler <lr@hpl.hp.com> wrote:
>
>> It is reasonable to assume that the person who asked what the purpose
of
>> the 'salt' argument was had crypt available.
>
>My question was not what the purpose of the salt was. I meant "how is
it
>used in the encryption?".
>
>--
> Kevin Reid. | Macintosh.
> "I'm me." | Think different.
You are right, Kevin. Your question was not what the purpose of the
salt was. Your question was what the purpose of the salt *is*. This
was your question (direct copy marked with leading : ):
: What is the purpose of the salt?
:
: --
: Kevin Reid. | Macintosh.
: "I'm me." | Think different.
And not one person here who actually tried to answer the question
thought it referred to seasoning and suggested adding pepper also. We
tried to answer "how is it used in the encryption?"
It was stupid of me to misunderstand your question.
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: 30 May 1998 01:02:21 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6ko3st$s3n$1@monet.op.net>
Keywords: emission hebephrenic malpractice Sandia
In article <6knnlf$2m4$1@plug.news.pipex.net>,
Jeremy Goldberg <jgoldberg@dial-but-dont-spam.pipex.com> wrote:
>> THE ON-LINE DOCUMENTATION DOES NOT EXPLAIN THE PURPOSE OF THE SALT.
>
>
>According to the UNIX man pages:
>
> "salt is a two-character string chosen from the set
> [a-zA-Z0-9./]. This string is used to perturb the algo-
> rithm in one of 4096 different ways."
Yes, that's right.
It doesn't answer the question, which is what the salt is *for*.
It doesn't even explain how to choose it.
You'd have to have an awful lot of insight to deduce it from that
one-sentence description of what crypt does with it at the very lowest
level.
>That's the theory, anyway - it sometimes seems to make no difference beyond
>tacking the salt on the front of the crypted output (although at other times
>it DOES change the output).
No way, dude. I dare you to come up with an example where the output
is the same after the first two characters.
------------------------------
Date: 30 May 1998 01:08:03 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6ko47j$s54$1@monet.op.net>
In article <fl_aggie-2905982307020001@aggie.coaps.fsu.edu>,
I R A Aggie <fl_aggie@thepentagon.com> wrote:
>Dominus wrote:
>+ THE ON-LINE DOCUMENTATION DOES NOT EXPLAIN THE PURPOSE OF THE SALT.
>
>Well, duh. I know that. However...
>
>THE ONLINE DOCUMENTATION I SPEAK OF COVERS THE FINE SYSTEM LIBRARY THAT
>CONTAINS THE ROUTINES THE IMPLENTS crypt, NOT THE PERL DOCUMENTATION
>THAT GIVES A BRIEF OVERVIEW OF THE *HOOKS* IN PERL TO USE THE UNDERLYING
>LIBRARY.
You're digging yourself in pretty deep here.
You were talking about the crypt(3) documentation.
So was I.
It does not explain the purpose of the salt.
You know that joke about the guy in the restaurant, the waiter brings
his soup, and the guy says, ``Waiter, please taste the soup!''
``Sir, I can take it back and bring you another if it isn't to your
liking.''
``Taste the soup!''
``Sir, I can't. It's against our policy.''
``Taste the soup!''
``But it's a violation of health regulations.''
``Taste the soup!''
``Very well... Say, where's your spoon?''
``Aha!''
>In unix, one might say 'man 3 crypt'.
You might, but it won't help you if you want to find out what the salt
is for. Next time maybe you should taste the soup.
------------------------------
Date: Fri, 29 May 1998 22:02:33 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6ko3tf$dpf@hplntx.hpl.hp.com>
I R A Aggie wrote in message ...
>In article <6knd03$qj3$1@monet.op.net>, mjd@op.net (Mark-Jason Dominus)
wrote:
>
>+ In article <fl_aggie-2905981721540001@aggie.coaps.fsu.edu>,
>+ I R A Aggie <fl_aggie@thepentagon.com> wrote:
>+ >In which case, they have the on-line documentation for the library
>+ >question...again, the problem isn't the documentation so much as
>+ >people being unaware or too lazy of how to find the information...
>+
>+ Hello? Hello? Is this thing on?
>
>+ THE ON-LINE DOCUMENTATION DOES NOT EXPLAIN THE PURPOSE OF THE
SALT.
>
>Well, duh. I know that. However...
>
>THE ONLINE DOCUMENTATION I SPEAK OF COVERS THE FINE SYSTEM LIBRARY THAT
>CONTAINS THE ROUTINES THE IMPLENTS crypt, NOT THE PERL DOCUMENTATION
>THAT GIVES A BRIEF OVERVIEW OF THE *HOOKS* IN PERL TO USE THE
UNDERLYING
>LIBRARY.
>
>AFAIK, perl does NOT ship with a crypt() library, and is dependent on
>the system its installed on to provide a crypt() that it can use.
>
>If, as presumed, the person _has_ crypt(), then the person _should_
have
>the documentation covering that library. This documentation is SEPERATE
>from the perl documentation.
This *_should_* is a total non sequitur that reveals how blind the "Unix
is the World" folks are. In a previous post, I presented the `perl -v`
of the MKS Perl for Windows, which does support crypt and does include
all of the Perl documentation. It also includes a good shell and dozens
of fine Unix (Posix) command-line utilities. But it DOES NOT INCLUDE A
C COMPILER OR THE C LIBRARY OR THE C LIBRARY DOCUMENTATION!
Is that too hard for anyone to grasp??? Maybe you need to be as stupid
as I am to understand it. C compilers are separate products made by
other vendors, and are not required to use Perl, and are not purchased
by users who do not need to do C development.
>In unix, one might say 'man 3 crypt'.
But this is not Unix. That's the point, dammit.
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: Fri, 29 May 1998 22:36:17 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6ko5sr$eg6@hplntx.hpl.hp.com>
John Moreno wrote in message
<1d9stxm.10o8t8m15hjr2eN@roxboro0-055.dyn.interpath.net>...
<BIG snip>
>> --
>> Larry Rosler
>> Hewlett-Packard Laboratories
>> lr@hpl.hp.com
>
>The sigdash includes a space that follows the two dashes.
>
>--
>John Moreno
That's what my mailer just put out below. Wonderful convention:
invisible trailing space. Congratulations to whoever dreamed that up.
I'll make sure it's there from now on.
Response to the rest in my next response to brian d foy.
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: 30 May 1998 03:06:49 GMT
From: fraserwag@aol.com (Fraserwag)
Subject: Re: expanding a perl variable back to the shell
Message-Id: <1998053003064900.XAA13277@ladder01.news.aol.com>
Thanks very much! I'll be anxious all weekend to try your solution. Cheers.
Simon
------------------------------
Date: Sat, 30 May 1998 04:19:16 GMT
From: Carton Lao <carton.lao@shaw.wave.ca>
To: Fraserwag <fraserwag@aol.com>
Subject: Re: expanding a perl variable back to the shell
Message-Id: <356F897E.ED6E7451@shaw.wave.ca>
The backslash "\" is the escape character, therefore you need to put in 2 of them
if you really mean to have the \ character.
system( "copy d:\\temp\\release....." );
Regards.
Carton
Fraserwag wrote:
> Hi,
>
> I'm new to perl. I am using perl for win32 to write an NT software release
> script for our manufacturing operation. I'm creating paths and files names as
> follows:
>
> print "enter the name of the file";
> $filename = <STDIN>;
> print "enter the destination path";
> $destpath = <STDIN>;
>
> The problem occurs when I am ready in the script to copy my files. I'm doing
> this as follows:
>
> system ("copy d:\temp\release\$filename $destpath\$filename");
>
> Whenever I reach this point in the execution of the script, I'm getting an
> error stating that the command syntax is incorrect. Can someone point out what
> I'm sure is a REALLY obvious problem? My assumption is that once I return to
> the shell, I lose the ability to expand the variables. Any comments gratefully
> received. Thanks.
>
> Simon
------------------------------
Date: Fri, 29 May 1998 21:28:34 -0500
From: "Kermit Tensmeyer" <kermit@ticnet.com>
Subject: Re: Have we got a good free Perl manual?
Message-Id: <6knqtj$6lu@enews2.newsguy.com>
John Porter wrote in message ...
>On 28 May 1998 22:02:52 -0400,
>in article <sd7k975zvek.fsf@mescaline.gnu.org>,
>rms@gnu.org (Richard Stallman) wrote:
>>
>> Once upon a time, I thought I would learn Perl. I got a copy of a
>> free manual, but I found it simply unreadable, and gave up. Perl
>> users told me that there were better manuals, but they were not free.
>
>So all this time we've been arguing about the definition of "free",
>we should have been arguing about the definition of "good".
Once upon a time, I tried to learn Emacs by reading the 'free'
manual, and the free 'tutorial'.
at the time there was not even -any- good manuals anywhere.
If it hadn't been for Epoch, I would have never learned the
One-True-Editor.
(oh yes, I learned Epoch so I could work on Perl [version 3],
even the documents for Perl were usable then.
I had to relearn Perl when Version 4 came out. The first
Camel book was real helpful. It wasn't free under any sense of
the word. but it had more worth than all the 'info' based
documention. )
--
Kermit Tensmeyer kermit@ticnet.com
Dallas, TX Life is too short to worry much...
------------------------------
Date: Sat, 30 May 1998 05:05:04 GMT
From: dwright@thuntek.net
Subject: Help with a Socket Problem
Message-Id: <6ko420$jqc$1@nnrp1.dejanews.com>
Hi, I have a PERL script that creates a socket to port 80 on a server and
runs a PERL script on that server. The line I use to print to the socket is
as follows:
print S "HEAD $url HTTP/1.0\n\n";
Where S is the socket and $url is the complete URL for the PERL script to be
run. Now, this has worked just fine but recently I am running into
problems. The script sends me an email indicating a bad response and lately
I have been receiving the 403 forbidden response and further research seems
to indicate that servers using the latest version of the Apache choke on this.
Can anyone tell me if there is a different way of doing this that will help.
Thanks in advance...
David Wright
dwright@thuntek.net
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 30 May 1998 01:11:50 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Install: Sorry, but how to install a module?
Message-Id: <6ko4em$s6f$1@monet.op.net>
Keywords: countrywide hypothalamus Lomb tori
In article <356F4C52.982ECC26@kiel.netsurf.de>,
Ulf Wendel <ulf.wendel@kiel.netsurf.de> wrote:
>So I did but: ha, ha - funny. Can anyone tell me what I have to do with
>the "t" subdirectory of any modulename.tar?
It has test scripts in it. After you install the module, run the
tests and see if they work.
Then forget about them.
Or yu can just skip directly to step 2.
------------------------------
Date: Sat, 30 May 1998 12:03:13 +0800
From: Jean-Yves Sireau <noemail@noemail.com>
Subject: perl & AOL AIM
Message-Id: <356F8501.509F@noemail.com>
I am looking to send a message to an AOL Instant Messager user from a
perl script. ie., the perl script initiates the message to the AOL
Instant Messanger user. I already know what IP address the AIM user is
at - I just need help in finding out how AIM communicates over the
socket connection. If anyone can help me, I'd be most grateful.
Jean-Yves Sireau
Email : jys @
hk.super.net
------------------------------
Date: Sat, 30 May 1998 04:25:26 GMT
From: michaeldore@hotmail.com (Michael Dori)
Subject: PLEASE HELP ME ... I need input on this from as many people as possible.
Message-Id: <35708a19.8351211@news.nacs.net>
And yes i know there are free search engines available for free ... my
ISP will not allow it ... i need to do this, and i have never done
this, and i need help ... i have only written small programs and would
appreciate all the help and/or sample files anyone could provide ...
and i cannot afford the camel book, and no i cannot go to the library
to get it ... they do not have a copy, it was stolen...
I am developing an algorithm for a search engine for a simple site.
The pages will be located in a small directory structrue like below
root/
root/store1
root/store2
root/store3
In each directory will be the html files ... i have developed the
following steps to try to make a search engine ... i would appreciate
all the input people can provide me.
using PERL
1. Get a list of all of the directories.
2. Read the directories into an array.
a. Begin loop 1/ change the directory located in array
slot number x
b. Do a directory of all html files
c. Place the results into a second array.
1. Begin loop 2 / read in the first HTML file and
search for the first instance of the search
string.
2. Find the preceding period, and then forward to
the next non HTML charachter.
3. Place the next 50 charachters into a HASH with
the string as element one, title to element
two, and the file handle to element three.
4. Continue search from last instance of search
string until file is completed.
5. Go to next HTML file ... probably handled as a
while(array_of_filenames[x])
d. Change to the next directory and continue the loop ...
probably with the same type of loop as before.
3. Print out the results as folows in a seperate loop at the end.
a. Print out the file header. (done once obviously)
b. Begin loop 3 / Print out the string result as a link
to the file with the file title, and other pertinent
info.
c. Print out the footer.
end the loop / end the program ...
Thanks ahead of time for the input.
Mike Dori
michaeldore@hotmail.com
------------------------------
Date: 30 May 1998 03:11:29 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: read and write
Message-Id: <896498320.457685@thrush.omix.com>
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>snip<
: I want
: open FOO, 'foo' or die;
: $/ = undef;
: $contents = <FOO>;
: close FOO or die;
: to make $contents into contents of 'foo'. Currently it will not if
: 'foo' is empty.
But if $foo is undef, $foo is even more empty then if it was ''.
But if you really want '', use read():
open FOO, 'foo' or die $!;
defined (read FOO, $contents, (stat FOO)[7], 0) or die $!;
close FOO or die $!;
Heck, it's even less lines to type. :-)
What about the not so small problem when working with non-normal
file descriptors? If <HANDLE> didn't return undef on a closed
socket connection, how would you know it closed? You'd have
to add a lot more code.
: (And do not tell me that on some filesystems 0-length files have no
: storage allocated, I know, and I do not care. ;-)
This wouldn't matter. Most current Unix systems don't store
anything past the last byte of data no matter what the size,
and the ones that do have a read(2) that supports it by leaving
it off when asking for data.
: This smells like a bad initial choice when C library functions were
: first defined.
It's not C, it's the diamond op. If you use read() you don't
have the undef problem.
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: 30 May 1998 04:21:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: read and write
Message-Id: <6ko1gg$9b2$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Zenin
<zenin@bawdycaste.org>],
who wrote in article <896498320.457685@thrush.omix.com>:
> Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> >snip<
> : I want
> : open FOO, 'foo' or die;
> : $/ = undef;
> : $contents = <FOO>;
> : close FOO or die;
> : to make $contents into contents of 'foo'. Currently it will not if
> : 'foo' is empty.
>
> But if $foo is undef, $foo is even more empty then if it was ''.
Correct. I do not want it to be more empty than it should be.
> But if you really want '', use read():
>
> open FOO, 'foo' or die $!;
> defined (read FOO, $contents, (stat FOO)[7], 0) or die $!;
I do not think anybody can guarantie that (stat FOO)[7] bytes are
enough to get the file contents.
> close FOO or die $!;
>
> Heck, it's even less lines to type. :-)
>
> What about the not so small problem when working with non-normal
> file descriptors? If <HANDLE> didn't return undef on a closed
> socket connection, how would you know it closed? You'd have
> to add a lot more code.
I do not see how this is relevant. If the socket is closed, but some
data are not read, you first get the rest of the data, then EOF.1
> : This smells like a bad initial choice when C library functions were
> : first defined.
>
> It's not C, it's the diamond op. If you use read() you don't
> have the undef problem.
<> is supposed to be more user-friendly than read.
Ilya
------------------------------
Date: Sat, 30 May 1998 03:11:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Reading whole file into a scalar
Message-Id: <Pine.GSO.3.96.980529200050.6742Q-100000@user2.teleport.com>
On 30 May 1998, Shaun Sides wrote:
> I don't think you can read a file into a scalar.
You left off the smiley. :-) It's hard to imagine that Perl _wouldn't_
be able to perform such a simple task as reading a file into a scalar.
> There's a variable $\ which contains the record separator. The default
> value for this is \n, and changing that value isn't recommended.
You mean $/ of course. Who says changing it is not recommended? If you
don't want to surprise the rest of your code, though, it's probably best
to change it only locally, as others have shown.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 29 May 1998 23:59:42 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: seek advice on simple first program
Message-Id: <alecler-2905982359420001@dialup-624.hip.cam.org>
Why not open the file only once, with read and write access?
In this example, $" is used to add the newlines... no substitution necessary!
($" is documented in perlvar.)
-----------------------
#!/usr/bin/perl -w
$" = "\n";
foreach $file (@ARGV) {
open(F, "+<$file")
or warn "Couldn't open '$file': $!\n" and next;
@content = <F>;
truncate(F, 0);
print F "@content\n";
close F;
}
-----------------------
Have fun with Perl,
A.L.
=======================
In article <slrn6mu2la.2vd.arch@abts.net>, arch@abts.net wrote:
> Yay. I've managed to actually write a useful little program in Perl.
> ;-) All it does is doublespace a file. I have a couple of ideas for
> some other simple things I can try my hand at, too. So, what I'd like
> to know is just how inefficient my algorithm is, brief advice on same,
> and that sort of thing. Hell, if someone wants to show me a totally
> obfuscated version of it, go ahead! ;-) I'm sure I'd learn something
> from it.
>
> #!/usr/bin/perl -w
> # ds.pl --> Double-space
> # Program to take single spaced text files and add an
> # extra \n to the end of each line.
> # usage: ds <filename1> <filename1> <...> <filenamen>
>
> foreach $file (@ARGV) {
> open FILE, $file || die "Can't open $file $!";
> while (<FILE>) {
> s/(.\n)$/$1\n/;
> s/^\n$/\n\n/;
> push @file, $_;
> }
> close FILE || die "Can't close $file $!";
> open FILE, ">$file" || die "Can't open $file for write $!";
> print FILE @file;
> undef @file;
> }
> # EOF ds.pl
>
> I see that loading the whole file into an array could cause some barfing
> if the size were significant. I thought about trying to use $^I, but
> figured that I can modify it that way later on. Or even come up with a
> better way.
>
> --
> ==============================================================================
> Shaun L. Sides | Hey! CyberGold | arch@abts.net
> Free Randal Schwartz and Ric Flair! | wastes yer time | arch@sara.mmlc.nwu.edu
> ==============================================================================
> The time for desperation is upon us. Let's play.
> First Wizard Zeddicus Zu'l Zorander
> ==============================================================================
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 2766
**************************************