[10028] in Perl-Users-Digest
Perl-Users Digest, Issue: 3621 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 2 16:05:17 1998
Date: Wed, 2 Sep 98 13:01:57 -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 Wed, 2 Sep 1998 Volume: 8 Number: 3621
Today's topics:
Re: Perl Cookbook, does anyone have it? (Jonathan Stowe)
Re: Perl documentation (grep: use GNU grep!) (David Combs)
Re: Perl documentation (David Combs)
Re: Perl gurus opinion needed. <jdporter@min.net>
Re: Perl gurus opinion needed. (Craig Berry)
Re: Perl gurus opinion needed. (Jonathan Stowe)
PERL Script/Module to read mailbox file. jteens@my-dejanews.com
Perl-based INETD Server for NT?? <george.kuetemeyer@mail.tju.edu>
Re: Perl-based INETD Server for NT?? (Jonathan Stowe)
Re: print "Content-type:text/html\n\n"; and redirection (Jonathan Stowe)
printing bitmap of integer hintze.k@amstr.com
Re: printing bitmap of integer <rootbeer@teleport.com>
Re: Tom Phoenix: ANSWERS WANTED! birgitt@my-dejanews.com
Re: Tom Phoenix: ANSWERS WANTED! (Nathan V. Patwardhan)
Re: trouble getting df output on remote boxes <jloucks@shell6.ba.best.com>
Re: Why Perl ? <r.goeggel@atos-group.de>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 02 Sep 1998 18:51:28 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl Cookbook, does anyone have it?
Message-Id: <35ed7f00.1721074@news.btinternet.com>
On Mon, 31 Aug 1998 11:15:16 -0400, John Porter wrote :
>Mark-Jason Dominus wrote:
>>
>> 12 kilos rice
>
>Typo -- should be 120 kilos of rice.
>
>
>> Personally, I think it sounds like it needs about a pound
>> of sage, but I realize that that would not be authentic.
>
>No; but I would use cumin and sumac, and several kilos of
>either dried limes or pickled lemons.
>
>
>> Good thing the recipe calls for a medium camel;
>> I don't think the local stores carry them any larger.
>
>Well, I have yet to see camels raised for food (or anything else,
>for that matter) in the U.S.; but llama farms are not unherd of.
>
> Llama a la Ram-a
>
<etc>
Oh this is a fine time for me to discover that Perl is not recommended
by the Vegetarian Society - Mind you I hate to think what they would
have in the "Python Cookbook".
Mrs Gellyfish was just recounting how she had "Camel pad stew" in
Egypt a few years ago - apparently it was barely edible.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Wed, 2 Sep 1998 19:14:22 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Perl documentation (grep: use GNU grep!)
Message-Id: <dkcombsEyo83y.MwK@netcom.com>
You want something neat, try gnu grep, egrep.
Provides -A<n>, likewise -B<n>, for <n> num lines
After or Before (you can use both).
And it does it "right" when the ranges overlap for
found occurrences.
Other things too, but the -A and -B enable all kind
of neat searching, esp when looking for English style
errors.
What I often do is run the grep, then via vi or emacs,
running case-independent, change the looked for pat,
eg foo, to <<<FOO>>>, so I can SEE it easier in the
output (usually saved to a file).
Once you have used gnu egrep, you can't do without it.
My opinion, anyway.
------------------------------
Date: Wed, 2 Sep 1998 19:21:04 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Perl documentation
Message-Id: <dkcombsEyo8F5.GB@netcom.com>
In article <6s98cj$6t$2@ligarius.ultra.net>,
Bob Trieger <sowmaster@juicepigs.com> wrote:
>[ posted to usenet and courtesy e-mail sent to lvirden@cas.org]
>
>lvirden@cas.org wrote:
>->
>-> I am averaging 3-4 spams a day and I post quite a bit. I don't delete
>-> my spam identified mail automatically - my spam filters on sites tend to
>-> pick up legit email and mailing list traffic along with the garbage.
>-> I need to clean out that list and start over I guess...
>
>Filter out any mail with relay*UU.NET, ybecker or bellglobal in the
>headers and you can cut that down to 3 or 4 a week.
>
>
>Bob Trieger
>sowmaster@juicepigs.com
Here is what I do. First, I am on several mailing lists,
so I surely want to read those, and not even check them
for spam. I want to check only those NOT on them.
So I first run this "source" (csh) file (yes, I should
make it into a runnable script; too lazy).
Here it is:
Stopped
{netcom10:281} cat summarize-mail.source
mail -H >! t25
egrepin lynx t25 >! t26.lynx
egrepin trn t25 >! t26.trn
egrepin copyediting t25 >! t26.ce
egrepin -v 'copyediting|lynx|trn' t25 >! t26.rest
wc t25 t26.*; tail -5 t25
echo ""
echo ""
echo ""
echo 'look at t26.{lynx, ce, trn, rest}'
echo ""
echo ""
echo ""
cat t26.rest
{netcom10:282}
{netcom10:282}
{netcom10:282} alias egrepin
/u5/bodysurf/Bin/egrep -in !*
{netcom10:283}
Then, with that display on the screen, I run
"mail -N", give the command "d", followed
to the right by numbers of obvious spam articles.
Works pretty well.
(I then q, and rerun mail the normal way, the
spam articles gone by now).
------------------------------
Date: Tue, 01 Sep 1998 14:11:54 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl gurus opinion needed.
Message-Id: <35EC38EA.D226B1C@min.net>
Dmitry Dorofeev wrote:
>
> I have possibly{0,1} new word for general purpose use.
> it's sounds 'Perlacker'.
>
> Problem: I am not native English speacker.
> Maybe Perlacker has some associations with NOT good things?
Possibly.
Wh-, j-, sl-, sm-, .....
> My friends (at St.-Petersburg, Russia) already use this word.
Go ahead and use it, if that's what seems natural.
Don't expect native English speakers to pick it up, though.
"Perl Hacker" suits us just fine.
John Porter
------------------------------
Date: 2 Sep 1998 18:00:28 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl gurus opinion needed.
Message-Id: <6sk13s$d1c$1@marina.cinenet.net>
Dmitry Dorofeev (butthead@ruxy.org.ru) wrote:
: I have possibly{0,1} new word for general purpose use.
: it's sounds 'Perlacker'.
To me, that reads as 'Perl Lacker' -- one who lacks (does not have)
Perl. Thus it has exactly the opposite sense from what you desire.
That's just my opinion, though.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 02 Sep 1998 19:30:13 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl gurus opinion needed.
Message-Id: <35ed9475.7052754@news.btinternet.com>
On Tue, 01 Sep 1998 14:11:54 -0400, John Porter wrote :
>Dmitry Dorofeev wrote:
>>
>> I have possibly{0,1} new word for general purpose use.
>> it's sounds 'Perlacker'.
>>
>
>Go ahead and use it, if that's what seems natural.
>Don't expect native English speakers to pick it up, though.
>"Perl Hacker" suits us just fine.
>
Of course there are people in Britain who already pronounce "Perl
Hacker" as Dmitry proposes (or would if they had cause to utter the
phrase) (Think My Fair Lady).
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Wed, 02 Sep 1998 18:43:51 GMT
From: jteens@my-dejanews.com
Subject: PERL Script/Module to read mailbox file.
Message-Id: <6sk3l7$6fd$1@nnrp1.dejanews.com>
Hi there, I've 1 POP email account and I want everyone to read my mailbox
file without use POP or IMAP protocol (I don't want to give out my login &
password to everyone). So I want to create web based email (for read message
only) to handle my mailbox (/var/spool/mail/mymailbox) directly. I'm looking
for perl script/module to handle mailbox file directly. Any help would be
mostly appreciated. Thanks, Paul
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 02 Sep 1998 14:08:01 -0400
From: George Kuetemeyer <george.kuetemeyer@mail.tju.edu>
Subject: Perl-based INETD Server for NT??
Message-Id: <35ED8980.A52BD26B@mail.tju.edu>
I'm looking for a perl-based INETD server for NT (Didn't find an obvious
reference to this via CPAN). Am currently using Pragma's INETD server,
which does a great job at a reasonable cost (the product provides INETD
services AND telnet daemon, etc.), but want a perl version that I can
include with a set of perl-based client/server NT administration modules
that I've developed. I like the INETD approach because my admin server
object can just use standard in/out. No worrying about lack of NT fork
capabilities, etc. Clients just connect to the assigned port, causing
INETD to kick off a separate instance of my server script for each
request.
Thanks in advance.
------------------------------
Date: Wed, 02 Sep 1998 19:30:15 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl-based INETD Server for NT??
Message-Id: <35ed976f.7814948@news.btinternet.com>
On Wed, 02 Sep 1998 14:08:01 -0400, George Kuetemeyer wrote :
>I'm looking for a perl-based INETD server for NT (Didn't find an obvious
>reference to this via CPAN).
<snip>
In the 1st Edition of Programming Perl (the Pink Camel) there was an
example called receptionist. The examples are not in the Blue Camel
however. The problem with this is that it use fork() and thus you
would need a build of Perl that supported fork() on the Win32 platform
(and as far as I know that is cygwin32). If you can find the example
code you could try to alter it to work without fork() of course.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Wed, 02 Sep 1998 18:51:32 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: print "Content-type:text/html\n\n"; and redirection...
Message-Id: <35ed8cd4.5099841@news.btinternet.com>
On Wed, 2 Sep 1998 16:22:02 +0100, Simon Wistow wrote :
>
>IIS also sometimes complains if you don't put
>
>print "HTTP/1,0 200 OK\n";
>
>before the content type statement. However having this produces an error
>if put it on my Unix server. Yet another case where Miro$loth just *HAD*
>to be different.
>
Right. But using CGI.pm will insulate you against these exigencies to
some extent - it will attempt to determine the OS and attempt to do
the right thing under the circumstances. The CGI module is included
with all recent distributions of Perl and is also available from CPAN
for those not blessed with a recent distribution.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 2 Sep 1998 19:02:46 GMT
From: hintze.k@amstr.com
Subject: printing bitmap of integer
Message-Id: <6sk4om$2vi$1@orthanc.reference.com>
I am trying to print the bitmap of an integer. I thought that
unpack would do what I need, but when I try:
$i = 8;
print unpack("B*", $i), "\n";
I get 00111000 instead of 00001000 like I would expect.
I tried again:
$i = 9 + 0; # emphasize that it is integer
print unpack("H*", $i), "\n";
prints 39
Why do unpacked integers have a spare 0x30 added to them?
Thanks,
Kai.
--------------------------------------------------------------------
Posted using Reference.COM http://WWW.Reference.COM
FREE Usenet and Mailing list archive, directory and clipping service
--------------------------------------------------------------------
------------------------------
Date: Wed, 02 Sep 1998 19:29:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: printing bitmap of integer
Message-Id: <Pine.GSO.4.02A.9809021226390.29974-100000@user2.teleport.com>
On 2 Sep 1998 hintze.k@amstr.com wrote:
> when I try:
>
> $i = 8;
> print unpack("B*", $i), "\n";
>
> I get 00111000 instead of 00001000 like I would expect.
That's because unpack works on strings, and your string '8' is an ASCII
character with that bit pattern.
Maybe you want to pack your number as a char before unpacking? Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 02 Sep 1998 18:17:53 GMT
From: birgitt@my-dejanews.com
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <6sk24h$4h4$1@nnrp1.dejanews.com>
In article <6shfkr$igr$1@info.uah.edu>,
Greg Bacon <gbacon@cs.uah.edu> wrote:
> In article <alecler-0109981303140001@dialup-690.hip.cam.org>,
> alecler@cam.org (Andre L.) writes:
> : It is quite unreasonable to demand answers like you do. The man has the
> : right to respond in the manner he deems appropriate, and that is all.
> : Besides, he knows what he's doing.
>
> If this is the case, then why doesn't your argument apply to Abigail
> or tchrist?
Who said it doesn't ? Andre L.? Of course they can answer as they seem
appropriate and they do. Can't you accept diversity in temperaments ?
so, did N. Patwardhan's question help reduce silly noisy answers like
this one ?
Birgitt Funk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 02 Sep 1998 18:59:20 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Tom Phoenix: ANSWERS WANTED!
Message-Id: <cAgH1.126$kE2.1100174@news.shore.net>
birgitt@my-dejanews.com wrote:
: so, did N. Patwardhan's question help reduce silly noisy answers like
: this one ?
Maybe or maybe not! But it won't be possible to give you the correct
answer until we measure this newsgroup and it weighs less than a
phonebook for the burrough of Queens. Hope this helps!
--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>
------------------------------
Date: 2 Sep 1998 18:39:43 GMT
From: Jim Loucks <jloucks@shell6.ba.best.com>
Subject: Re: trouble getting df output on remote boxes
Message-Id: <6sk3df$r80$1@nntp1.ba.best.com>
Argh! I can't believe it was that easy.
Thanks, Tony.
BTW, I only added the chomp to my script and it works
without passing a parameter. But I like your code much
better and will implement that style from now on.
Thanks again.
Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at> wrote:
: Re: trouble getting df output on remote boxes, Jim
: <jloucks@shell6.ba.best.com> said:
: Jim> while (<hosts>) { $host=$_; &getdf; }
: Urgh, parameter? &getdf($host);
: You need to get rid of the newline off of the line you read
: from the hosts file, viz.
: while (<hosts>) {
: chomp;
: &getdf($_);
: }
: Jim> sub getdf {
: my $host = shift; # get passed in parameter
: Jim> ....
: Jim> }
: hth
: tony
: --
: Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
: Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
: "You see? You see? Your stupid minds! | private email:
: Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Wed, 2 Sep 1998 18:56:52 +0200
From: "Ronald Gvggel" <r.goeggel@atos-group.de>
Subject: Re: Why Perl ?
Message-Id: <6sjtgo$je5$1@news.pop-stuttgart.de>
dn5006@my-dejanews.com schrieb in Nachricht
<6shjlf$7e5$1@nnrp1.dejanews.com>...
>Try the following script:
>
>#!/usr/bin/perl
>print ":-) ";
>while (<>) { print eval; print ( ($@ || "\n") . ":-)" ) }
>
Yes, I read the Camel book too and found
#!/usr/bin/perl
while(<>) {
print eval $_;
die $@ if $Q;
}
but I changed "die" into "warn", add -w and I'm happy.
>And you can execute all Perl statements, define functions, or import
and
>execute a Perl script. This interactive Perl is great to learn Perl,
to try
>out Tom Christ 's Cook book.
This interactive Perl is great
Ronald
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3621
**************************************