[13339] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 749 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 9 11:07:24 1999

Date: Thu, 9 Sep 1999 08:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 9 Sep 1999     Volume: 9 Number: 749

Today's topics:
    Re: Accessing NT DB from Linux Perl (Dan Wilga)
    Re: escaping curly braces (Abigail)
    Re: Fine then. Re: Sorry, Re: Why, why, why, -w and use (Larry Rosler)
    Re: Fine then. Re: Sorry, Re: Why, why, why, -w and use <jpeterson@office.colt.net>
    Re: How to echo "% f"? (Abigail)
    Re: mastering algorithms a munition? <rootbeer@redcat.com>
    Re: mastering algorithms a munition? <gellyfish@gellyfish.com>
    Re: my and hashes; Bug of PERL? (Abigail)
    Re: Opening URL with Perl (Abigail)
    Re: Perl fails tests (Abigail)
    Re: Perl fails tests <rootbeer@redcat.com>
        Perl, ODBC, IIS & SQL Server pyammine@my-deja.com
    Re: Perl, ODBC, IIS & SQL Server <jpeterson@office.colt.net>
    Re: redirection problems (Abigail)
    Re: ref to array of ref to arrays (Abigail)
    Re: run .exe and get result? (WinNT) <craig@mathworks.com>
    Re: run .exe and get result? (WinNT) (Abigail)
    Re: run .exe and get result? (WinNT) <olivier.maas@at-lci.com>
    Re: Script to create subshell that sends input/output t <rootbeer@redcat.com>
    Re: Smile... (Greg Martin)
    Re: Sorry, Re: Why, why, why, -w and use strict? (Abigail)
    Re: suggestions for CRAP (Kragen Sitaker)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 09 Sep 1999 10:26:06 -0400
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: Accessing NT DB from Linux Perl
Message-Id: <dwilgaREMOVE-0909991026060001@wilga.mtholyoke.edu>

In article <37d669c6_1@news2.one.net>, Brent Foster <brent@one.net> wrote:

> You need to get a commercial ODBC driver for the Linux box.
> I think OpenLink software makes one.  Check their web site
> at http://www.openlinksw.com/

And once you've got that, you'll need to install DBI and DBD::ODBC on the
Linux box.

Dan Wilga          dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply  **


------------------------------

Date: 9 Sep 1999 09:39:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: escaping curly braces
Message-Id: <slrn7tfhq3.pg8.abigail@alexandra.delanet.com>

Mario Schrijver (mario.schrijver@cans.nl) wrote on MMCC September
MCMXCIII in <URL:news:7r88is$hme$2@newnews2.news.nl.uu.net>:
"" Has anybody got a clue how to escape curly braces which surround a record?
"" 
"" like
"" 
"" { "-1" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"2305" ,"" ,"" ,"" ,"" ,"" ,""}

And the context is? The only place I can imagine where you need to escape
curly braces is in regexes. Where you would do it the usual way; as explained
in the manual.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 9 Sep 1999 07:11:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Fine then. Re: Sorry, Re: Why, why, why, -w and use strict?
Message-Id: <MPG.12415fcb3ca9fdae989f39@nntp.hpl.hp.com>

In article <7r832t$ma9$0@216.39.133.13> on 9 Sep 1999 10:44:45 GMT, 
Robert Front <robertf@emerald.oz.net> says...
 ...
> Well here is my real e-mail address.  I'm not really Bart Simpson. (but you
> knew that)
> 
> Just so you know, I'm not switching to my real address just to stay out of
> Abigale's killfile.  The only time she posts anything is to tell people
> they're idiots and/or adding them to her killfile.

1.  That's Abigail, not Abigale.

2.  You are presumptuous to assume his/her/its gender based on a nom de 
keyboard.

3.  Abigail's substantive answers are among the most cogent and 
instructive in this newsgroup.

4.  His/her/its JAPHs are worth a study unto themselves.

So whether or not you are killfiled, don't reciprocate!  :-)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Thu, 09 Sep 1999 14:42:24 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Fine then. Re: Sorry, Re: Why, why, why, -w and use strict?
Message-Id: <kHPB3.103$xa4.1347@news.colt.net>

Larry Rosler <lr@hpl.hp.com> wrote:

> 2.  You are presumptuous to assume his/her/its gender based on a nom de 
> keyboard.

Nothing wrong with presuming. I'm certainly not going to spend my time calling
people on newsgroups 'it' just because I don't know their sex.

> 3.  Abigail's substantive answers are among the most cogent and 
> instructive in this newsgroup.

Not to mention the rarest ;->



------------------------------

Date: 9 Sep 1999 09:31:39 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to echo "% f"?
Message-Id: <slrn7tfhbi.pg8.abigail@alexandra.delanet.com>

Joseph O'Rourke (orourke@grendel.csc.smith.edu) wrote on MMCC September
MCMXCIII in <URL:news:37d7a877.0@news.smith.edu>:
'' When I try to read the string "% f" and print it out, it prints
'' as " 0.000000".  I am using this simple program test.pl:
'' 
'' #!/usr/bin/perl
'' while (<>) {
''         printf $_;
'' }

Did you read the manual what printf does?



Abigail
-- 
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} #  Yet Another silly JAPH by Abigail
sub A::FETCH     {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 9 Sep 1999 07:38:56 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: mastering algorithms a munition?
Message-Id: <Pine.GSO.4.10.9909090729490.16999-100000@user2.teleport.com>

On Thu, 9 Sep 1999, David Turley wrote:

> I've been pouring over "Mastering Algorithms in Perl" and see that
> this book will be one of those "I need a copy at work and at home"
> books, like the Cookbook.
> 
> On page 549 the RSA algorithm in Perl is printed, along with a warning
> that t-shirts, etc with this printed on them are classed as munitions
> by the US. So, does this mean that this book is also a munition?

Legal advice from non-lawyers on Usenet is a lot like a drug in a bottle
labelled "drink me". Take it at your own risk.

But I'd say "Yes, it's classed as a munition, but the law isn't generally
enforced against mere books." 

Nevertheless, this isn't really a Perl issue, is it? And I'd hate to see
this newsgroup filled with rants against the US government, flames against
those rants, arguments about whether freedom of the press applies to books
in electronic form, and everything else that goes with that. Follow-ups
set, if there are Perl-related follow-ups.

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: 9 Sep 1999 15:44:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: mastering algorithms a munition?
Message-Id: <37d7c7e9_2@newsread3.dircon.co.uk>

David Turley <dturley@pobox.com> wrote:
> 
> On page 549 the RSA algorithm in Perl is printed, along with a warning
> that t-shirts, etc with this printed on them are classed as munitions by
> the US. So, does this mean that this book is also a munition?
> 

Apparently books are exempt - the international version of PGP was taken
from code OCR'd from a book ;-}

/J\
-- 
"It's easier for a man to enter a camel is he stands on a box" -
Jonathan Creek


------------------------------

Date: 9 Sep 1999 09:34:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: my and hashes; Bug of PERL?
Message-Id: <slrn7tfhh9.pg8.abigail@alexandra.delanet.com>

Bernd Kronmueller (Bernd.Kronmueller@eedn.ericsson.se) wrote on MMCC
September MCMXCIII in <URL:news:37D7AC6A.1E13EAAA@eedn.ericsson.se>:
\\ 
\\ we encountered here a problem and we can't explain what is going on.

Read up the manual about soft references to find out why this is
happening, and read the FAQ why you shouldn't use soft references
this way.

\\ #! /usr/loacal/bin/perl -w

/usr/loacal is a funny name for a directory.




Abigail
-- 
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 9 Sep 1999 09:40:45 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Opening URL with Perl
Message-Id: <slrn7tfhsk.pg8.abigail@alexandra.delanet.com>

Oliver Christian Kjær (Oliver@pop.k-net.dk) wrote on MMCC September
MCMXCIII in <URL:news:7r89e6$e2a$1@news.net.uni-c.dk>:
\\ Is it possible with a Perl script to open a html file on the internet,
\\ it could be http://www.something.com/something.html,
\\ and save it on the disk (on the server). ???

Yes.

\\ I have looked many places on the net, but haven't found anything
\\ on that subject. Any help would be appreciated.

It's only being asked here once an hour or so.


Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 9 Sep 1999 09:42:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl fails tests
Message-Id: <slrn7tfhva.pg8.abigail@alexandra.delanet.com>

Justin Smith (jsmith@mcs.drexel.edu) wrote on MMCC September MCMXCIII in
<URL:news:37D7BE2B.DD8C5A6E@mcs.drexel.edu>:
"" When I build Perl 5.003 on my RedHat 6.0 system, it fails one of the
"" tests
"" (namely the DBM tests). This is significant because latex2html doesn't
"" work
"" on my system and people tell me that it's because Tied access to hashes
"" doesn't work properly.


Perhaps you should consider upgrading to a more recent version of Perl.
5.003 is 3 years old. Get 5.005_03.




Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 9 Sep 1999 07:41:11 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl fails tests
Message-Id: <Pine.GSO.4.10.9909090739491.16999-100000@user2.teleport.com>

On Thu, 9 Sep 1999, Justin Smith wrote:

> When I build Perl 5.003 on my RedHat 6.0 system, it fails one of the
> tests

Fixed in 5.004_xx and 5.005_xx. If you're having problems with a version
of Perl which is older than the Spice Girls, please consider using
something more recent. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 09 Sep 1999 13:55:21 GMT
From: pyammine@my-deja.com
Subject: Perl, ODBC, IIS & SQL Server
Message-Id: <7r8e82$cq6$1@nnrp1.deja.com>

I need some help.

I am trying to use Perl to connect to a SQL Server 7.0. I have 2
servers with NT Server. One with IIS 4 and one with SQL 7.0. The perl
scripts use WIN32::ODBC to connect.

I can get it to connect through the dos prompt fine but it doesn't
connect through my browser.

Here is the perl code that does the connection:

require "cgi-lib.pl";
print &PrintHeader;
&ReadParse;

$| = 1;

use Win32::ODBC;
use strict;
$db = new Win32::ODBC ('WorkbenchSQL') || die "$db can't open
database";

It dies on the last line of course and 'WorkbenchSQL' is the DNS name.

After putting in print statements in the odbc.pm file to find where it
dies I was able to get this error message printed:

[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
user '\'.

To me the strangest part is that if I use Personal Web Server instead
of IIS 4.0 it works fine with the same code (on both the web browser
and command line).

I don't know if it is a Perl issue, ODBC, SQL Server or IIS but I would
appreciate any help.

Thx,  Pascal




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Thu, 09 Sep 1999 14:26:23 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Perl, ODBC, IIS & SQL Server
Message-Id: <jsPB3.102$xa4.1347@news.colt.net>

pyammine@my-deja.com wrote:
> I need some help.
> $db = new Win32::ODBC ('WorkbenchSQL') || die "$db can't open
> database";

> It dies on the last line of course and 'WorkbenchSQL' is the DNS name.

> [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
> user '\'.

> I don't know if it is a Perl issue, ODBC, SQL Server or IIS but I would
> appreciate any help.

It's not a perl issue. Perl is working just fine. Possibly, when run under IIS
the script does not have the right user privileges to log into the database.

Check with IIS, SQL server, ODBC and Win32::ODBC to see what's up.



------------------------------

Date: 9 Sep 1999 09:43:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: redirection problems
Message-Id: <slrn7tfi2j.pg8.abigail@alexandra.delanet.com>

Nico (weinachter@yahoo.com) wrote on MMCC September MCMXCIII in
<URL:news:37D7AA6F.821037E6@yahoo.com>:
// 
// I'm working on a web server with perl scripts and i have a little
// problem with path. In fact, i'm trying to make a script that can
// redirect a user on another site but i don't know how to do to send him
// there. Does anyone could helpme ?


That is not a Perl question. Redirection should be done on the HTTP
level. RTFM of your http server.



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 9 Sep 1999 09:45:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: ref to array of ref to arrays
Message-Id: <slrn7tfi51.pg8.abigail@alexandra.delanet.com>

kev (kevin.porter@fast.no) wrote on MMCC September MCMXCIII in
<URL:news:37D77668.8C254AE9@fast.no>:
^^ 
^^ I need to know how to get hold of the values from the results returned
^^ from the DBI method selectall_arrayref. The docs say it returns "a
^^ reference to an array containing references to arrays for each row of
^^ data fetched".
^^ This is a little beyond me. How do I read, say, the second row? Or the
^^ fourth column in the fifth row, etc?


You would start with reading the manual pages about references,
datastructures and list of lists.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 09 Sep 1999 10:09:03 -0400
From: Craig Ciquera <craig@mathworks.com>
Subject: Re: run .exe and get result? (WinNT)
Message-Id: <37D7BF7F.223FF4A7@mathworks.com>

Sounds like a problem with your environment.

Is catdoc in you path?  Have you tried specifying the full path to catdoc??

Craig
Olivier Maas wrote:

> It is what I first tried
>
> My answer is then that the given name is not recognized as an internal or
> external command, An executable prog or a command file
> the same line with system("catdoc -w test.doc"); gets a recognized answer
> (256)



------------------------------

Date: 9 Sep 1999 09:47:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: run .exe and get result? (WinNT)
Message-Id: <slrn7tfi9u.pg8.abigail@alexandra.delanet.com>

Olivier Maas (olivier.maas@at-lci.com) wrote on MMCC September MCMXCIII
in <URL:news:37D7B1D8.E940FFF3@at-lci.com>:
\\ Hello,
\\ I would like from a perl scripts launched with NT/IIS to run a .exe and
\\ get the result in my perl script or in a file
\\ 
\\ I tried:
\\ system("catdoc -w test.doc");


Did you actually read the manual about system?



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 09 Sep 1999 16:51:59 +0200
From: Olivier Maas <olivier.maas@at-lci.com>
Subject: Re: run .exe and get result? (WinNT)
Message-Id: <37D7C98E.EF23A7C6@at-lci.com>

effectively, the full path solves it
I use a
qx(fullpath\catdoc -w fullpath\args 1>fullpath\destination);    # statement

thanks for your help...
blue skies and soft landings
olivier

The last thing I have to do to make it work is to truncate the name if my files
to 8 chars for catdoc.exe is 16 bits and wont use long names.... :-(

Craig Ciquera a écrit :

> Sounds like a problem with your environment.
>
> Is catdoc in you path?  Have you tried specifying the full path to catdoc??
>
> Craig
> Olivier Maas wrote:
>
> > It is what I first tried
> >
> > My answer is then that the given name is not recognized as an internal or
> > external command, An executable prog or a command file
> > the same line with system("catdoc -w test.doc"); gets a recognized answer
> > (256)



------------------------------

Date: Thu, 9 Sep 1999 07:11:24 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Script to create subshell that sends input/output to a socket
Message-Id: <Pine.GSO.4.10.9909090702551.16999-100000@user2.teleport.com>

On Thu, 9 Sep 1999, Dominic Da Silva wrote:

> Ala Qumsieh wrote:
> 
> > Dominic Da Silva <dsdasilva@earthlink.net> writes:
> >
> > > I am trying to write a script to start of a shell (ie take 
> > > commands and execute them),
> > > but also have any screen info sent to a socket.
> > > It would be basically like the typescript command, except 
> > > that out put will be redirected
> > > to a socket rather than a file.
> > > Any help will be appreciated.
> >
> > What exactly is the help you are seeking? I can cook really 
> > good eggs if you want :)
> >
> > --Ala

> How about sticking that egg up your ass instead.

Three points to draw to your attention:

Perhaps you didn't realize that Ala was trying to help you. Your message
described what you were trying to do, but didn't say what kind of help you
needed. Ala was hinting that perhaps you only needed a good meal to get
started with your program. Based upon the evidence, that's as good a guess
as any.

Perhaps you didn't realize that the odd punctuation near the end of Ala's
message was a smiley. I'm not trying to be condescending here; I honestly
consider it possible that you didn't see or recognize that Ala was smiling
to indicate that the message wasn't intended maliciously. If the message
is sincerely sent with best intentions, it's best to try to read it in
that light.

Perhaps Ala had the wrong idea. When working with eggs, it's generally
neither practical nor desirable to create a subshell. :-)

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Thu, 09 Sep 1999 14:14:30 GMT
From: gregm@netidea.com (Greg Martin)
Subject: Re: Smile...
Message-Id: <37d7c009.2744675@news.netidea.com>

On Wed, 08 Sep 1999 19:38:12 GMT, Karl Schmidt <nospam@nospam.de>
wrote:


>Y to K problem has made any sense to me but I understand it is a=20
>global problem, and our team is glad to help in any way possible.
>
I feel much better now. I kept hearing about this ear-to-cake problem
and thinking what a silly lot. Just take the cake out of your ear. I
see now the problem was some what more serious.
Regards,
Marie Antoinette



------------------------------

Date: 9 Sep 1999 09:55:28 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Sorry, Re: Why, why, why, -w and use strict?
Message-Id: <slrn7tfio7.pg8.abigail@alexandra.delanet.com>

Remco Gerlich (scarblac-spamtrap@pino.selwerd.cx) wrote on MMCC September
MCMXCIII in <URL:news:slrn7tfb8b.k76.scarblac-spamtrap@flits104-37.flits.rug.nl>:
## Bart Simpson <phony@nospam.com> wrote:
## > My ISP recommended using a phony address when posting to newsgroups because
## > he says it cuts down on spam.
## 
## Then use a phony address. "phony@nospam.com" is completely legal,
## and the people at nospam.com won't be happy with you using it.

Part of the problem with address mungers is that those people tend to
be clueless, and cause other people to have more work; more work than
they save by deleting a spam a day.

It's probably that those people are still afraid of the Internet; they
heard about spamming, and got terrified.



Abigail
-- 
perl -wlne '}print$.;{' file  # Count the number of lines.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Thu, 09 Sep 1999 14:33:25 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: suggestions for CRAP
Message-Id: <VyPB3.13118$r5.902041@typ11.nn.bcandid.com>

In article <x7lnbkb2on.fsf@home.sysarch.com>,
Uri Guttman  <uri@sysarch.com> wrote:
> [while (<x>) {push @y, $_} removed]
> slurping a whole file may be poor, but the while/push loop is pathetic.

 . . . using subsets of Perl is officially OK, right?  The guy just 
doesn't know about list-context <>.  That doesn't mean he's pathetic;
it just means he doesn't know all of Perl.

>this has my favorite moron code, multiple print statements.

Same for that.  (Didn't Larry mention not knowing about here docs as
one of the things he saw a lot, would never do himself, but considered
OK for other people to do?  Didn't he explicitly use that as an example
of using a baby-talk subset of Perl, and how that was OK?)

I don't know all of Perl either.  Here's a script to prove it.  It's
runnable at http://pobox.com/~kragen/sw/rfc-index.cgi.  It's
essentially zgrep with some HTMLizing of the output.

Good points:
- decent grasp of Perl and secure programming, I hope.  (Uses CGI.pm, uses
        -w and -T and strict, cleans up ENV, etc.)

Bad points:
- cleans up $ENV{PATH} and $ENV{IFS} even though it's a CGI script, not
        a setuid program.
- includes hardcoded paths (CGI.pm is in my home dir; so is gzip.
        (There isn't a zlib module, is there?))
- uses popen, and so is nonportable.
- uses $/ instead of using IO::Handle::autoflush.
- uses ugly regexes.
- outputs HTML by hand instead of using CGI.pm methods.
- $_ = "<p>$_\n"; print;.  Say no more.  :)

Feel free to send me your flames or praise.  :)

(Originally I emailed this; Uri suggested I post it.)

#!/bin/perl -wT
require 5;
use strict;
$ENV{PATH}='/usr/local/bin:/bin:/usr/bin';
$ENV{IFS}=" \t\n";

# Grab paragraphs from rfc-index matching pattern.
# It's pretty cheap right now.
# BEGIN { unshift @INC, "/home3/kragen/public_html"; }
use lib '/home3/kragen/public_html';
use CGI;

my $query = new CGI;
my $searching = defined $query->param('pattern');

my $pattern;
if ($searching) {
   $pattern = $query->param('pattern');
   $pattern = quotemeta $pattern unless $query->param('regexp');
   $pattern = "(?i)$pattern" if ((not defined ($query->param('case_sensitive'))) or 
      $query->param('case_sensitive') ne 'yes');
}

my $title = $searching ? "RFCs matching $pattern" : "Search RFC index";

print <<eoh;
Content-type: text/html

<html><head><title>$title</title></head>
<body
bgcolor="#ffffff" text="#000000" link="#0000ff" alink="#ff0000"
vlink="#aa00aa">
<h1>$title</h1>
eoh

print $query->startform(-action => $ENV{'SCRIPT_NAME'}, -method=>'GET'), "\n",
      "<p> <em>Last updated 1999-03-02</em>\n<p>",
      "Search pattern: ", $query->textfield('pattern'), "\n",
      $query->checkbox(-name => 'case_sensitive', -label => 'Case sensitive',
            -value => 'yes'), "\n",
      $query->checkbox(-name => 'regexp', -label => 'Regular Expression search',
            -value => 'yes', -checked => 1), "\n",
      $query->submit, "\n",
      $query->endform, "\n";

if ($searching) {
   my $records = 0;

   $/ = "";  # paragraphs
   open INPUT, "/home3/kragen/bin/gzip -dc /home3/kragen/public_html/rfc-index-entries.txt.gz |";
   while (<INPUT>) {
      if (/$pattern/o) {
         /^([\s]*)(\d+)(.*)/ or warn "Can't find the number: $_";
         my $number = $2;  $number =~ s/^0*//;
         /\(Format(?::[\s\n]*|=)([^)]*)\)/ or /\(Not online\)/ or 
            warn "Can't find the format: $_";
         my $formats = $1; my @formats = split /,\s*/, $formats;
         my $format;
         # This is pretty ugly.
         foreach $format (@formats) {
            # The format changed recently.  It used to be
            # (Format=.txt, .ps); now it's (Format: TXT=1824 bytes,
            # PS=1 bytes).
            if ($format =~ /^\.[a-z]*$/) {
               #$_ .= qq(<a href="http://ds.internic.net/rfc/rfc$number$format">rfc$number$format</a> );
               $_ .= qq(<a href="http://info.internet.isi.edu:80/in-notes/rfc/files/rfc$number$format">rfc$number$format</a> );
            } elsif ($format =~ /^([A-Z]+)=\d+/) {
               my $ext = $1;  $ext =~ tr/A-Z/a-z/;
               # $_ .= qq(<a href="http://ds.internic.net/rfc/rfc$number.$ext">rfc$number.$ext</a> );
               $_ .= qq(<a href="http://info.internet.isi.edu:80/in-notes/rfc/files/rfc$number.$ext">rfc$number.$ext</a> );
            }
         }
         $_ = "<p>$_\n";
         print;
         $records++;
      }
   }
   print "<hr> <p> Found $records RFCs.";
}

print <<eof;
</body></html>
eof

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Thu Sep 09 1999
60 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 749
*************************************


home help back first fref pref prev next nref lref last post