[17664] in Perl-Users-Digest
Perl-Users Digest, Issue: 5084 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 11 18:10:42 2000
Date: Mon, 11 Dec 2000 15:10:20 -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: <976576220-v9-i5084@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 11 Dec 2000 Volume: 9 Number: 5084
Today's topics:
Need help to replace passwd - New at this ! msalerno@my-deja.com
Re: Need help to replace passwd - New at this ! (Chris Fedde)
Re: Need help to replace passwd - New at this ! (Chris Fedde)
Re: need help with split <monty@primenet.com>
Re: need help with split <mjcarman@home.com>
Re: need help with split <jmourney@hotmail.com>
Re: net:: <enigmabomb@home.gotohellspammers.ihopeyourotinghellyouspamminggarbage.com>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Newbie s/// problem (Brcin)
Re: Newbie s/// problem <uri@sysarch.com>
Re: Newbie s/// problem <monty@primenet.com>
Re: Problem understanding references <peter.sundstrom@eds.com>
Re: Qmail Attachments (Mark-Jason Dominus)
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: String Manipulation (David H. Adler)
Testing deliverability with Perl and Sendmail -bv <vautourNO@SPAMunb.ca>
Re: Testing deliverability with Perl and Sendmail -bv <elijah@workspot.net>
Re: Visual Perl (Chris Fedde)
Why do people think Perl is ugly? (Vent); was: Why isn' miko@idocs.com
Re: Why do people think Perl is ugly? (Vent); was: Why (Craig Berry)
Re: Why do people think Perl is ugly? (Vent); was: Why (NP)
Re: Why isn't Perl highly orthogonal? (Mark-Jason Dominus)
Re: Why isn't Perl highly orthogonal? (Craig Berry)
Re: Win32::ODBC/MSAccess query <greg2@surfaid.org>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 11 Dec 2000 21:03:44 GMT
From: msalerno@my-deja.com
Subject: Need help to replace passwd - New at this !
Message-Id: <913ffc$uha$1@nnrp1.deja.com>
I am working on a script that will allow me to change the password of a
user. Here is the problem, I cannot use the passwd command. I need to
edit the /etc/passwd file. What I am looking to do is to change the
password for a particular user. I do not need to encrypt the password
since I will be using a default pre-encrypted password.
I want to just replace the password for a user. I don't want to delete
the line and then append it to the bottom. The only thing that I want
to change in the passwd file is the password field. I hate having to
screw around with the /etc/passwd file, and this is why I want to change
it as little as possible, just the password field. I am currently
working with something like this :
setpwent();
my($username, $passwd, $uid, $gid, $quota, $comment, $name, $dir,
$shell)=getpwent;
print "\nUserName: $username\n";
print "PassWord: $passwd\n";
print "UID: $uid\n";
print "GID: $gid\n";
print "Comments: $comment\n";
print "Name: $name\n";
print "Home Dir: $dir\n";
print "Shell: $shell\n\n";
Any help is appreciated.
Thanks,
Matt
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 11 Dec 2000 21:57:12 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Need help to replace passwd - New at this !
Message-Id: <Y4cZ5.153$B9.187359744@news.frii.net>
In article <913ffc$uha$1@nnrp1.deja.com>, <msalerno@my-deja.com> wrote:
>I am working on a script that will allow me to change the password of a
>user. Here is the problem, I cannot use the passwd command. I need to
>edit the /etc/passwd file. What I am looking to do is to change the
>password for a particular user. I do not need to encrypt the password
>since I will be using a default pre-encrypted password.
On my system
perl -F: -lapi.bak -e '
s/^cfedde:[^:]+:/cfedde:ddsElcoX/00Ns:/
' /etc/master.passwd
seems to work.
chris
--
This space intentionally left blank
------------------------------
Date: Mon, 11 Dec 2000 21:59:22 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Need help to replace passwd - New at this !
Message-Id: <_6cZ5.154$B9.170600448@news.frii.net>
In article <Y4cZ5.153$B9.187359744@news.frii.net>,
Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
>In article <913ffc$uha$1@nnrp1.deja.com>, <msalerno@my-deja.com> wrote:
>>I am working on a script that will allow me to change the password of a
>>user. Here is the problem, I cannot use the passwd command. I need to
>>edit the /etc/passwd file. What I am looking to do is to change the
>>password for a particular user. I do not need to encrypt the password
>>since I will be using a default pre-encrypted password.
>
>On my system
>
> perl -F: -lapi.bak -e '
> s/^cfedde:[^:]+:/cfedde:ddsElcoX/00Ns:/
Of course that should have been
s{^cfedde:[^:]+:}{cfedde:ddsElcoX/00Ns:}
> ' /etc/master.passwd
>
--
This space intentionally left blank
------------------------------
Date: 11 Dec 2000 19:43:43 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: need help with split
Message-Id: <913apf$6uo$1@nnrp2.phx.gblx.net>
Joe <jmourney@hotmail.com> wrote:
> thank you jim i appreciate you experimenting with it. but you're
> missing the point of my question. please read the following.
I think YOU are still missing the point. Please re-read my suggestion
to more carefully read whatever warning message you're getting.
> Jim Monty <monty@primenet.com> wrote:
> > Joe <jmourney@hotmail.com> wrote:
> > > but when the script processes records which are missing one
> > > or more fields, the split function assigns undef or null to
> > > the corresponding variables.
> >
> > How does the split function know which fields are missing and which
> > variables to assign undef to?
Think carefully about this question.
> > > as you know, it generates some
> > > warning messages when i try to use these variables.
> > >
> > > my question is: should i be concerned with the warning messages?
> >
> > Yes.
> >
> > > if so, what must be done?
> >
> > Read the warnings more carefully.
> >
> > > other than that, the code works okay.
> >
> > No it doesn't.
> >
> > > to explain what i mean, try the above code with the following
> > > record:
> > >
> > > MVCD05 1,2 SPA Residencia San Juan de La Penitencia
> >
> > This record will not provoke a warning.
> >
> > $ ./films
> > language is FRE, title is Au Revoir les Enfants
> > language is GRK, title is Euripides Medea
> > language is SPA, title is Residencia San Juan de La Penitencia
> > $
>
> of course your code won't, because you didn't try to print the call
> number! (which is missing on the example above). add the following
> line to your code:
>
> print "call number is $callnum\n";
>
> and you'll know what i mean by it creating a warning message.
No, I won't:
$ cat films
#!/usr/local/bin/perl -w
use strict;
while (<DATA>) {
chomp;
my ($id, $callnum, $copies, $lang, $title) = split ' ', $_, 5;
print "call number is $callnum\n";
}
__END__
MVCD01 Qa1.B75 1,2,3,4 FRE Au Revoir les Enfants
MVCD02 Ha4.B32 1,*,2,3 GRK Euripides Medea
MVCD05 1,2 SPA Residencia San Juan de La Penitencia
$ ./films
call number is Qa1.B75
call number is Ha4.B32
call number is 1,2
$
See? No warning message. But the output is, of course, wrong (i.e.,
not what you expect).
Do as I've done and post both the code you're running and it's
actual output, including the warning message. You have two problems:
one that we can already see (a logic error) and another one that
we cannot yet see (probably a syntax error).
--
Jim Monty
monty@primenet.com
Tempe, Arizona USA
------------------------------
Date: Mon, 11 Dec 2000 12:36:54 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: need help with split
Message-Id: <3A351EC6.27F11CD8@home.com>
Joe wrote:
>
> thank you jim i appreciate you experimenting with it. but you're
> missing the point of my question. please read the following.
And you're missing the point of his. :)
> Jim Monty <monty@primenet.com> wrote:
> >
> > This record will not provoke a warning.
> >
> > [...]
>
> of course your code won't, because you didn't try to print the call
> number! (which is missing on the example above). add the following
> line to your code:
But neither will yours. The split will misparse the line, putting data
into the wrong variables. Look back at Jim's first example, which you
trimmed, but I've restored:
>> $ cat films
>> #!/usr/local/bin/perl -w
>>
>> use strict;
>>
>> while (<DATA>) {
>> chomp;
>> my ($id, $callnum, $copies, $lang, $title) = split ' ', $_, 5;
>> print "language is $lang, title is $title\n";
>> }
>>
>> __END__
>> MVCD01 Qa1.B75 1,2,3,4 FRE Au Revoir les Enfants
>> MVCD02 Ha4.B32 1,*,2,3 GRK Euripides Medea
>> MVCD05 1,2 SPA Residencia San Juan de La Penitencia
>> $ ./films
>> language is FRE, title is Au Revoir les Enfants
>> language is GRK, title is Euripides Medea
>> language is Residencia, title is San Juan de La Penitencia
See the "language is Residencia?"
If you can have missing fields, then you can't use plain whitespace as a
delimeter. Since they don't appear to be fixed-width, you can't use
substr(). In that case, you'll have to use a fancier regexp, which is
what his second example did. This is a seperate issue from getting
warnings about uninitialized variables.
-mjc
------------------------------
Date: Mon, 11 Dec 2000 22:27:01 GMT
From: Joe <jmourney@hotmail.com>
Subject: Re: need help with split
Message-Id: <913kbd$2pu$1@nnrp1.deja.com>
In article <913apf$6uo$1@nnrp2.phx.gblx.net>,
Jim Monty <monty@primenet.com> wrote:
> I think YOU are still missing the point. Please re-read my suggestion
> to more carefully read whatever warning message you're getting.
I got 2 people telling me I missed the point, so I probably am =)
Jim posted 2 codes, first one with split and second one with match.
I understand about what you are saying about the first one:
It does not generate any warnings, but it returns wrong data to wrong
variable.
I didn't bother to try it since Jim already proved it not working
properly, and I understand why. What I tried was the second code he
posted (with matching), and here's what I have:
penguin:~/test> cat t.pl
#!/usr/bin/perl -w
use strict;
while (<DATA>) {
chomp;
my ($id, $callnum, $copies, $lang, $title) = m{
^
([A-Z]+\d+) # id
\s+
([A-Za-z]+\d+\.[A-Z]\d+)? # callnum (optional)
\s+
(\S+) # copies
\s+
([A-Z]{3}) # lang
\s+
(\S.*) # title
}x;
print "id : |$id|\n";
print "call : |$callnum|\n"; ######### HERE ##########
print "copies: |$copies|\n";
print "lang : |$lang|\n";
print "title : |$title|\n\n";
}
__END__
MVCD01 Qa1.B75 1,2,3,4 FRE Au Revoir les Enfants
MVCD02 Ha4.B32 1,*,2,3 GRK Euripides Medea
MVCD05 1,2 SPA Residencia San Juan de La Penitencia
And here's what I get when I run the above code:
penguin:~/test> t.pl
id : |MVCD01|
call : |Qa1.B75|
copies: |1,2,3,4|
lang : |FRE|
title : |Au Revoir les Enfants|
id : |MVCD02|
call : |Ha4.B32|
copies: |1,*,2,3|
lang : |GRK|
title : |Euripides Medea|
id : |MVCD05|
Use of uninitialized value at tt.pl line 23, <DATA> chunk 3.
call : ||
copies: |1,2|
lang : |SPA|
title : |Residencia San Juan de La Penitencia|
Notice what I did with Jim's original code: to illustrate my point,
I added the line printing the call number (marked ###### HERE #######).
As I said earlier:
>> as you know, it generates some
>> warning messages when i try to use these variables.
>>
>> my question is: should i be concerned with the warning messages?
>> other than that, the code works okay.
>
> No it doesn't.
Yes it works properly that:
1) it doesn't misplace the wrong data to wrong variable
2) the code doesn't terminate even after processing many records with
missing fields
The code I have originally uses split instead of match, and it works
just like the above. My question is, should i be concerned with such
warning messages as shown above?
Thank's again!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 11 Dec 2000 21:58:25 GMT
From: "EnIgMaBoM" <enigmabomb@home.gotohellspammers.ihopeyourotinghellyouspamminggarbage.com>
Subject: Re: net::
Message-Id: <56cZ5.33377$w35.6111264@news1.rdc1.nj.home.com>
Dually Noted, But where would the domain name go?
"David Efflandt" <efflandt@xnet.com> wrote in message
news:slrn939fnb.1oc.efflandt@efflandt.xnet.com...
> On Mon, 11 Dec, EnIgMaBoM <enigmabomb@home.afraid.of.spam.com> wrote:
> >will net::: do backwards translation from a domain to an IP addy?
>
> I think you mean forward translation, reverse lookup is when you resolve a
> domain name for a given IP. I don't know what net::: is, but you can
> resolve a name to an IP with:
>
> $ip = join(".",unpack("C4",scalar gethostbyname($host)));
>
> --
> David Efflandt efflandt@xnet.com http://www.de-srv.com/
> http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
> http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Mon, 11 Dec 2000 21:20:39 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <t3ah978jm12qc0@corp.supernews.com>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 04 Dec 2000 21:16:00 GMT and ending at
11 Dec 2000 13:46:13 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2000 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 190 (42.1% of all posters)
Articles: 347 (25.5% of all articles)
Volume generated: 568.4 kb (24.0% of total volume)
- headers: 270.7 kb (5,446 lines)
- bodies: 289.0 kb (10,263 lines)
- original: 200.2 kb (7,554 lines)
- signatures: 8.4 kb (218 lines)
Original Content Rating: 0.693
Averages
========
Posts per poster: 1.8
median: 1.0 post
mode: 1 post - 118 posters
s: 2.1 posts
Message size: 1677.4 bytes
- header: 798.8 bytes (15.7 lines)
- body: 852.8 bytes (29.6 lines)
- original: 590.6 bytes (21.8 lines)
- signature: 24.7 bytes (0.6 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
19 25.6 ( 15.0/ 10.6/ 6.0) SimBean <schneider@xtewa.de>
12 16.7 ( 5.3/ 11.3/ 9.7) Fryar386 <fryar386@aol.com>
7 12.0 ( 5.1/ 6.0/ 4.4) Tim Hammerquist <tim@localhost.localdomain>
6 9.1 ( 5.4/ 3.7/ 1.5) "SuperGumby" <tick.toff@spam.com>
6 9.2 ( 6.0/ 2.9/ 2.4) Anthony Bouvier <anthony@notsoevil.com>
6 7.6 ( 5.4/ 2.2/ 2.2) "kcount" <kcount@ardenhouse.com>
5 5.6 ( 3.6/ 2.0/ 1.3) jrogers42@hotmail.com
5 6.5 ( 4.2/ 2.3/ 0.9) "Mark Kuin" <mkuin@globalrangers.com>
5 9.3 ( 4.3/ 3.8/ 2.0) Ilmari Karonen <usenet11301@itz.pp.sci.fi>
5 12.5 ( 4.4/ 6.8/ 5.1) Ilmari Karonen <usenet11296@itz.pp.sci.fi>
These posters accounted for 5.6% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
25.6 ( 15.0/ 10.6/ 6.0) 19 SimBean <schneider@xtewa.de>
16.7 ( 5.3/ 11.3/ 9.7) 12 Fryar386 <fryar386@aol.com>
12.5 ( 4.4/ 6.8/ 5.1) 5 Ilmari Karonen <usenet11296@itz.pp.sci.fi>
12.0 ( 5.1/ 6.0/ 4.4) 7 Tim Hammerquist <tim@localhost.localdomain>
10.5 ( 1.8/ 8.7/ 8.6) 2 "Fabian Thorbjörnsson" <fabian@markisspecialisten.com>
9.9 ( 3.2/ 6.7/ 3.6) 4 "Kelvin Sim" <kjs404@hotmail.com>
9.3 ( 3.3/ 6.0/ 2.5) 3 Kenny Pearce <kenny@kennypearce.net>
9.3 ( 4.3/ 3.8/ 2.0) 5 Ilmari Karonen <usenet11301@itz.pp.sci.fi>
9.2 ( 6.0/ 2.9/ 2.4) 6 Anthony Bouvier <anthony@notsoevil.com>
9.1 ( 3.6/ 5.5/ 1.4) 4 extramail@home.com
These posters accounted for 5.2% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 4.3 / 4.3) 4 Ted <ted_graham@my-deja.com>
0.990 ( 2.2 / 2.2) 6 "kcount" <kcount@ardenhouse.com>
0.894 ( 4.4 / 4.9) 4 alaugusto@my-deja.com
0.858 ( 2.3 / 2.7) 4 Neil Conway <spam@klamath.dyndns.org>
0.851 ( 9.7 / 11.3) 12 Fryar386 <fryar386@aol.com>
0.831 ( 2.1 / 2.5) 4 Adam Levenstein <cleon42@my-deja.com>
0.830 ( 2.4 / 2.9) 6 Anthony Bouvier <anthony@notsoevil.com>
0.761 ( 4.3 / 5.6) 3 "Katie Foster" <unknown@boat.bt.com>
0.760 ( 5.2 / 6.9) 3 "Edd" <edd@texscene.com>
0.749 ( 5.1 / 6.8) 5 Ilmari Karonen <usenet11296@itz.pp.sci.fi>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.535 ( 2.0 / 3.8) 5 Ilmari Karonen <usenet11301@itz.pp.sci.fi>
0.531 ( 3.6 / 6.7) 4 "Kelvin Sim" <kjs404@hotmail.com>
0.502 ( 2.3 / 4.5) 3 Ray Pendergraph <raypendergraph@my-deja.com>
0.423 ( 2.5 / 6.0) 3 Kenny Pearce <kenny@kennypearce.net>
0.407 ( 1.5 / 3.7) 6 "SuperGumby" <tick.toff@spam.com>
0.378 ( 0.9 / 2.3) 5 "Mark Kuin" <mkuin@globalrangers.com>
0.375 ( 0.5 / 1.3) 4 see
0.263 ( 1.4 / 5.5) 4 extramail@home.com
0.256 ( 0.5 / 1.9) 3 Nick <news@square-sun.co.uk>
0.232 ( 1.4 / 6.0) 4 erictwx@my-deja.com
28 posters (14%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
29 comp.lang.perl.modules
20 comp.lang.java.help
19 comp.lang.java.misc
19 comp.lang.java.programmer
16 comp.lang.perl
12 comp.lang.ruby
12 alt.perl
7 comp.lang.javascript
4 sci.image.processing
3 comp.os.ms-windows.misc
Top 10 Crossposters
===================
Articles Address
-------- -------
9 Kenny Pearce <kenny@kennypearce.net>
9 julian esteban <julian@rec.com>
8 Ray Pendergraph <raypendergraph@my-deja.com>
6 Anthony Bouvier <anthony@notsoevil.com>
5 Al Dev <alavoor@yahoo.com>
4 "Niek" <eager@curious.com>
4 Jim Sculley <niceguy@abraxis.com>
3 ivo <ivo@neroc.nl>
3 tt@cryogen.com
3 Peter Schuller <peter.schuller@infidyne.com>
------------------------------
Date: Mon, 11 Dec 2000 20:26:23 GMT
From: info@sz-brkini.si (Brcin)
Subject: Newbie s/// problem
Message-Id: <PLaZ5.790$0k3.1669@news.siol.net>
Hi. I need some help.
If I write $temp =~ s/.{5}$//; why it doesn't work if intead of {5} I write
{$blah}? $blah = 10
Thanx for any answers.
------------------------------
Date: Mon, 11 Dec 2000 20:45:08 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Newbie s/// problem
Message-Id: <x7lmtmk7qj.fsf@home.sysarch.com>
>>>>> "B" == Brcin <info@sz-brkini.si> writes:
B> If I write $temp =~ s/.{5}$//; why it doesn't work if intead of {5}
B> I write {$blah}? $blah = 10
define doesn't work. it works for me. show some input, and expected and
real output.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 11 Dec 2000 23:29:06 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: Newbie s/// problem
Message-Id: <913o02$7jp$1@nnrp1.phx.gblx.net>
Brcin <info@sz-brkini.si> wrote:
> If I write $temp =~ s/.{5}$//; why it doesn't work if intead of {5} I
> write {$blah}? $blah = 10
Good news! It DOES work!
$ perl -we '$temp = "z" x 20;
> $blah = 10;
> print "$temp\n";
> $temp =~ s/.{$blah}//;
> print "$temp\n";'
zzzzzzzzzzzzzzzzzzzz
zzzzzzzzzz
$
--
Jim Monty
monty@primenet.com
Tempe, Arizona USA
------------------------------
Date: Tue, 12 Dec 2000 09:27:47 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Problem understanding references
Message-Id: <913dc5$ise$1@hermes.nz.eds.com>
Uri Guttman <uri@sysarch.com> wrote in message
news:x7puizjvt8.fsf@home.sysarch.com...
> >>>>> "RZ" == Richard Zilavec <rzilavec@tcn.net> writes:
>
> RZ> On Mon, 11 Dec 2000 17:15:37 +1300, "Peter Sundstrom"
> RZ> <peter.sundstrom@eds.com> wrote:
>
>
> >> #!/usr/local/bin/perl -w
> >>
>
> RZ> use strict;
> RZ> no strict 'refs';
>
> RZ> This allows your code to execute by allowing symbolic and hard
> RZ> references.
>
> don't encourage use of symbolic references. they are balck magic and the
> OP is not skilled enough to use them.
>
> besides, his code didn't really use them. he was using a dotted quad as
> a file handle which is very odd. and that was what caused the symref
> error. there is no need for that, you can use Symbol to make new handles
> and store them in a hash indexed by the IP.
>
> open($addr, ">$addr.dat") or die "Can not open $addr.dat
>
> in fact why he opens the file named for the IP makes no sense either as
> he only prints the IP into it. maybe he meant to print all the unique
> IPs to one file.
OK, perhaps I didn't make my example very clear. I am dealing with a bunch
of IP addresses and I'm writing the IP address to a file named after the
network the IP address is in.
For example: 192.1.1.1 and 192.1.1.2 get written to a file called
192.1.1.0.dat and 10.1.1.1, 10.100.1.1 get written to a file called
10.0.0.0.dat
After playing around a bit, I came up with the following code. Is this any
better?
#!/usr/local/bin/perl -w
use strict;
use IO::File;
my ($fh,$addr,%ip);
while (<DATA>) {
chomp;
$addr=$_;
unless ($ip{$addr}) {
$ip{$addr} = IO::File->new(">$addr.dat") or die "Can not
open $addr.dat $!\n";
}
$fh=$ip{$addr};
print $fh "IP $addr\n";
}
__DATA__
192.1.1.1
192.1.1.2
192.1.1.3
192.1.1.1
192.1.1.2
192.1.1.2
------------------------------
Date: Mon, 11 Dec 2000 19:17:10 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Qmail Attachments
Message-Id: <3a352835.4a13$1c9@news.op.net>
In article <955-3A33D93D-87@storefull-116.iap.bryant.webtv.net>,
O R <OrlandoReeves@webtv.net> wrote:
>It works fine, but how do I go about including an image attachment?
Use the MIME::Lite module, which you can find at search.cpan.org.
It will format the attachment into a string, which you can then print
into qmail-inject.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Mon, 11 Dec 2000 21:20:34 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <t3ah92l88ji5be@corp.supernews.com>
Following is a summary of articles spanning a 7 day period,
beginning at 04 Dec 2000 21:16:00 GMT and ending at
11 Dec 2000 13:46:13 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2000 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@(?:.*\.)?perl\.com
Totals
======
Posters: 451
Articles: 1361 (482 with cutlined signatures)
Threads: 423
Volume generated: 2366.4 kb
- headers: 1050.4 kb (21,323 lines)
- bodies: 1257.6 kb (42,232 lines)
- original: 810.5 kb (29,085 lines)
- signatures: 57.1 kb (1,403 lines)
Original Content Rating: 0.644
Averages
========
Posts per poster: 3.0
median: 1 post
mode: 1 post - 228 posters
s: 5.7 posts
Posts per thread: 3.2
median: 2 posts
mode: 1 post - 118 threads
s: 2.9 posts
Message size: 1780.5 bytes
- header: 790.3 bytes (15.7 lines)
- body: 946.2 bytes (31.0 lines)
- original: 609.8 bytes (21.4 lines)
- signature: 42.9 bytes (1.0 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
73 130.3 ( 54.7/ 65.5/ 42.0) Tad McClellan <tadmc@metronet.com>
39 67.7 ( 32.9/ 34.7/ 18.6) abigail@foad.org
36 66.6 ( 25.7/ 39.5/ 18.6) Chris Fedde <cfedde@fedde.littleton.co.us>
29 48.2 ( 20.5/ 25.4/ 15.9) nobull@mail.com
27 99.4 ( 20.3/ 78.0/ 78.0) PerlFAQ Server <faq@denver.pm.org>
24 44.5 ( 17.8/ 22.1/ 11.2) efflandt@xnet.com
21 31.6 ( 13.2/ 18.4/ 7.6) Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
19 25.6 ( 15.0/ 10.6/ 6.0) SimBean <schneider@xtewa.de>
18 24.7 ( 13.8/ 11.0/ 6.1) Eric Bohlman <ebohlman@omsdev.com>
17 26.5 ( 13.1/ 12.0/ 4.6) Rafael Garcia-Suarez <rgarciasuarez@free.fr>
These posters accounted for 22.3% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
130.3 ( 54.7/ 65.5/ 42.0) 73 Tad McClellan <tadmc@metronet.com>
99.4 ( 20.3/ 78.0/ 78.0) 27 PerlFAQ Server <faq@denver.pm.org>
67.7 ( 32.9/ 34.7/ 18.6) 39 abigail@foad.org
66.6 ( 25.7/ 39.5/ 18.6) 36 Chris Fedde <cfedde@fedde.littleton.co.us>
48.2 ( 20.5/ 25.4/ 15.9) 29 nobull@mail.com
44.5 ( 17.8/ 22.1/ 11.2) 24 efflandt@xnet.com
38.2 ( 14.2/ 20.6/ 11.9) 17 mgjv@tradingpost.com.au
32.4 ( 14.5/ 17.7/ 9.3) 16 Bob Walton <bwalton@rochester.rr.com>
31.6 ( 13.2/ 18.4/ 7.6) 21 Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
28.6 ( 10.7/ 17.8/ 9.5) 14 garry@zvolve.com
These posters accounted for 24.8% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 78.0 / 78.0) 27 PerlFAQ Server <faq@denver.pm.org>
0.990 ( 2.2 / 2.2) 6 "kcount" <kcount@ardenhouse.com>
0.945 ( 4.5 / 4.7) 7 John Hunter <jdhunter@nitace.bsd.uchicago.edu>
0.857 ( 3.0 / 3.5) 7 "EM" <me@privacy.net>
0.851 ( 9.7 / 11.3) 12 Fryar386 <fryar386@aol.com>
0.840 ( 5.0 / 5.9) 6 "Elisa Roselli" <e.roselli@volusoft.com>
0.830 ( 2.4 / 2.9) 6 Anthony Bouvier <anthony@notsoevil.com>
0.828 ( 6.1 / 7.4) 10 "LimboStar" <dontspamme@awdang.com>
0.812 ( 1.7 / 2.1) 5 "Per- Fredrik Pollnow" <Per-fredrik.Pollnow@epk.ericsson.se>
0.749 ( 5.1 / 6.8) 5 Ilmari Karonen <usenet11296@itz.pp.sci.fi>
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.412 ( 7.6 / 18.4) 21 Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
0.407 ( 1.5 / 3.7) 6 "SuperGumby" <tick.toff@spam.com>
0.388 ( 4.6 / 12.0) 17 Rafael Garcia-Suarez <rgarciasuarez@free.fr>
0.379 ( 1.6 / 4.2) 9 Tony Curtis <tony_curtis32@yahoo.com>
0.378 ( 0.9 / 2.3) 5 "Mark Kuin" <mkuin@globalrangers.com>
0.355 ( 1.9 / 5.3) 9 H C <carvdawg@patriot.net>
0.350 ( 1.5 / 4.2) 6 "Randy Harris" <harrisr@bignet.net>
0.247 ( 1.0 / 3.9) 6 "John W. Krahn" <krahnj@acm.org>
0.239 ( 2.7 / 11.5) 12 flint@flintslacker.com
0.182 ( 1.0 / 5.3) 7 "kiel stirling" <taboo@comcen.com.au>
61 posters (13%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
22 Use PERL or Java? Which is faster?
21 Beginner's question
14 kill and security (suid)
13 references, hashes & arrays
12 array of unique random numbers
12 number vs string
11 List Values and Arrays
11 %ENV does not contain some variables?
10 Why isn't Perl highly orthogonal?
10 unsolved: <STDIN>
These threads accounted for 10.0% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
44.7 ( 20.7/ 23.2/ 14.0) 22 Use PERL or Java? Which is faster?
29.5 ( 11.1/ 17.9/ 7.4) 12 array of unique random numbers
29.5 ( 16.3/ 11.8/ 5.0) 21 Beginner's question
23.0 ( 10.9/ 11.5/ 6.9) 13 references, hashes & arrays
23.0 ( 10.8/ 11.5/ 5.1) 14 kill and security (suid)
20.8 ( 7.0/ 13.4/ 8.1) 9 Willing to review a 90 line Perl program?
20.6 ( 8.8/ 10.9/ 5.5) 11 List Values and Arrays
20.5 ( 5.2/ 14.5/ 10.6) 7 A sort of another color -- a Tale, not a question ;)
20.2 ( 8.6/ 11.2/ 6.7) 10 Sorting the result of a function
19.2 ( 8.3/ 10.2/ 6.1) 10 Why isn't Perl highly orthogonal?
These threads accounted for 10.6% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.858 ( 3.9/ 4.5) 6 help getting started with Active perl win32
0.835 ( 11.6/ 13.9) 5 Execute perl code enterred at run time?
0.805 ( 8.1/ 10.0) 6 PLEASE CHECK MY CODING!
0.789 ( 3.7/ 4.6) 7 eval() performance
0.752 ( 8.2/ 11.0) 5 Statistics for comp.lang.perl.misc
0.750 ( 2.4/ 3.2) 6 Duplicate Unix's time program on Windows
0.749 ( 4.2/ 5.6) 5 Algorithm::Diff -- why does diff() return LOLOL instead of LOL?
0.746 ( 1.3/ 1.8) 5 Help with metacharacters and search and replace
0.733 ( 10.6/ 14.5) 7 A sort of another color -- a Tale, not a question ;)
0.729 ( 2.1/ 2.9) 5 Two dimensional array to file.
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.416 ( 7.4 / 17.9) 12 array of unique random numbers
0.403 ( 2.8 / 6.8) 9 How do I find out my own IP Address?
0.388 ( 3.5 / 8.9) 8 ActivePerl Problem
0.382 ( 3.7 / 9.7) 8 Apache on Linux - Error on scripts called thru browser
0.379 ( 2.0 / 5.4) 8 help on regexp
0.342 ( 2.2 / 6.5) 5 Reading Data from STDIN
0.335 ( 1.9 / 5.7) 8 default method
0.315 ( 4.1 / 12.9) 6 Help with program
0.308 ( 1.3 / 4.3) 6 Format
0.273 ( 1.2 / 4.5) 5 learning perl, this does not work ... why?
97 threads (22%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
29 comp.lang.perl.modules
20 comp.lang.java.help
19 comp.lang.java.misc
19 comp.lang.java.programmer
16 comp.lang.perl
12 comp.lang.ruby
12 alt.perl
7 comp.lang.javascript
4 sci.image.processing
3 comp.os.ms-windows.misc
Top 10 Crossposters
===================
Articles Address
-------- -------
9 julian esteban <julian@rec.com>
9 Kenny Pearce <kenny@kennypearce.net>
8 Ray Pendergraph <raypendergraph@my-deja.com>
6 Sunil Matta <smatta@acm.org>
6 abigail@foad.org
6 Anthony Bouvier <anthony@notsoevil.com>
5 Johan Vromans <JVromans@Squirrel.nl>
5 Al Dev <alavoor@yahoo.com>
4 Tad McClellan <tadmc@metronet.com>
4 "Niek" <eager@curious.com>
------------------------------
Date: 11 Dec 2000 19:34:51 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: String Manipulation
Message-Id: <slrn93ab2r.cq1.dha@panix2.panix.com>
On 8 Dec 2000 18:01:57 GMT, Abigail <abigail@foad.org> wrote:
>On Sat, 2 Dec 2000 19:08:04 -0000, James Boulter (jbou@bunker79.fsnet.co.uk) wrote in comp.lang.perl.misc <URL: news:<90bhb9$uch$1@newsg2.svr.pol.co.uk>>:
>++ Dear all,
>++
>++ I have the string "James <email address>"
>++
>++ How can I get the information into two separate variables without the
>++ brackets.
>
>
>my ($first, $second) = $string =~ /([^<>]+)/g;
FWIW, the split() version seems *slightly* (the operative word
here... :-) faster:
#!/usr/local/bin/perl -w
use Benchmark;
$string = 'James <email address>';
timethese(1000000, {
'split' => sub {($q, $y) = split /[<>]/, $string;},
'regex' => sub {($q, $y) = $string =~ /([^<>]+)/g;}
});
Benchmark: timing 1000000 iterations of regex, split...
regex: 7 wallclock secs ( 7.32 usr + -0.00 sys = 7.32 CPU)
split: 6 wallclock secs ( 6.20 usr + 0.00 sys = 6.20 CPU)
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
I shall \0x0D - Nathan Roberts
------------------------------
Date: Mon, 11 Dec 2000 17:32:34 -0400
From: Gil Vautour <vautourNO@SPAMunb.ca>
Subject: Testing deliverability with Perl and Sendmail -bv
Message-Id: <3A3547F2.71EB9B4E@SPAMunb.ca>
Hello,
I was wondering if anyone knew a way using Perl and Sendmail to test an
email
address to see if it is deliverable before sending the message? I'm
using Perl to call Sendmail to send a standard message to a large file
of email addresses and I would like to check to see if the message will
get bounced and if so not send it at all. I know there is the -bv
option, will this do the job? More specifically how
in Perl would I be able to test the the result of -bv in order to send
or not?
Thanks,
------------------------------
Date: 11 Dec 2000 22:14:30 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Testing deliverability with Perl and Sendmail -bv
Message-Id: <eli$0012111701@qz.little-neck.ny.us>
In comp.lang.perl.misc, Gil Vautour <vautourNO@SPAMunb.ca> wrote:
> I was wondering if anyone knew a way using Perl and Sendmail to test
> an email address to see if it is deliverable before sending the
> message? I'm using Perl to call Sendmail to send a standard message
> to a large file of email addresses and I would like to check to see
> if the message will get bounced and if so not send it at all. I
> know there is the -bv option, will this do the job? More
> specifically how in Perl would I be able to test the the result of
> -bv in order to send or not?
Check the return code. sendmail will exit with 0 (zero) if it
thinks an address is deliverable and non-zero otherwise. The
particular non-zero value will tell you a little bit about why
the address is considered undeliverable.
#!/usr/bin/perl
my @addresses = ( 'boasdas@eeee...', 'boa@das@eeee...',
'boa@das@e..eee...', 'boasdas@ee.ee' );
for $_ (@addresses) {
my $message = `/usr/sbin/sendmail -bv $_`;
my $exit = $? >> 8; # see perldoc perlvar
if ($exit) {
print "Problem ($exit): $message\n";
} else {
print "Good to go: $message\n";
}
}
__END__
Good to go: boasdas@eeee...... deliverable: mailer esmtp, host eeee.,
user boasdas@eeee
Good to go: boa@das@eeee...... deliverable: mailer esmtp, host eeee.,
user boa@das@eeee
Problem (68): boa@das@e..eee...... Invalid host name
Good to go: boasdas@ee.ee... deliverable: mailer esmtp, host ee.ee.,
user boasdas@ee.ee
Try looking at /usr/include/sysexits.h to see the error names
associated with various sendmail exit values.
Elijah
------
#define EX_NOHOST 68 /* host name unknown */
------------------------------
Date: Mon, 11 Dec 2000 21:27:46 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Visual Perl
Message-Id: <mFbZ5.150$B9.170592256@news.frii.net>
In article <t39rsrj293gv78@corp.supernews.com>,
Justin and or Denitza <justinl@lvcablemodem.com> wrote:
>Does anyone else find it annoying that you have to be a Microsoft Certified
>Certification Class Taker to try out the Visual Perl Beta? Does anyone know
>a way around this? (please no replies like "hack the planet, save the
>rainforest, tell your boss to switch to BSD")
>
Microsoft?
Microsoft Visual Perl Beta?
From Microsoft?
Is this a joke?
No really. Is this a joke?
Hack the planet, save the rainforest, tell your boss to switch to BSD!
Oh... You said not to reply like that.... Oh well better luck next time.
:-)
chris
--
This space intentionally left blank
------------------------------
Date: Mon, 11 Dec 2000 19:34:44 GMT
From: miko@idocs.com
Subject: Why do people think Perl is ugly? (Vent); was: Why isn't Perl highly orthogonal?
Message-Id: <913a8k$poj$1@nnrp1.deja.com>
> IIRC, Larry Wall has referred to Perl as being a "diagonal" language.
> Instead of forcing a rigid method of doing things, Perl provides you
> with options and allows you to choose the most natural (i.e.
> idiomatic) method. Whether this is a good thing or a bad thing is
> largely a matter of preference. If you want a minimal language, then
> it's awful. But if you want to be able to write an arbitrary piece of
> code quickly and concisely, then it's wonderful.
Since we're on the topic of public perceptions of Perl, I'd like to
bring up something that's bothered me for quite a while. Why is Perl so
commonly described as "ugly" and "difficult"? When I first needed to
learn Perl I approached it with a sense of foreboding because I had been
told many times about how ugly the language is. One llama book and one
camel book later I still hadn't gotten to the "ugly" part. Four years
later I STILL haven't found the ugly part.
I think a lot of the perception has something to do with regular
expressions. Granted, regexes can get pretty confusing, but only to the
degree that the endeavor itself is confusing, and unlike most
languages, no MORE confusing than the endeavor itself. For example, if I
wanted to crunch down all whitespace to single spaces (as I often do
with web-based data entry), it's certainly simpler to use this code:
$name =~ s/\s+/ /g;
then the character-by-character looping that is necessary in languages
like Visual Basic. (That's not quite true anymore because most
languages help you with string processing with ... regular expressions!)
Furthermore, Perl has a wonderfully short DTHW (Distance To Hello
World). Ever notice that most Java books don't even get to Hello World
until the second chapter? That's because you have to learn all the
concepts before you even get to do something simple. Don't get me wrong,
I love Java, but it's hardly "simpler" than Perl.
OK, I'm done venting. This thread has just brought up the frustration I
sometimes feel when I'm working in other languages and I miss the
simplicity, conciseness and beauty of Perl.
-miko
--
Miko O'Sullivan
Author of The Mikodocs Guide to HTML
http://www.mikodocs.com/tags/
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 11 Dec 2000 21:30:00 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Why do people think Perl is ugly? (Vent); was: Why isn't Perl highly orthogonal?
Message-Id: <t3ahqorlds4q72@corp.supernews.com>
miko@idocs.com wrote:
: Since we're on the topic of public perceptions of Perl, I'd like to
: bring up something that's bothered me for quite a while. Why is Perl so
: commonly described as "ugly" and "difficult"? When I first needed to
: learn Perl I approached it with a sense of foreboding because I had been
: told many times about how ugly the language is. One llama book and one
: camel book later I still hadn't gotten to the "ugly" part. Four years
: later I STILL haven't found the ugly part.
I just hit the perfect analogy for Perl vs. orthogonal languages. Perl is
a blank canvas, a set of brushes, and a palette of oil paints. Highly
orthogonal languages are an etch-a-sketch.
Consider that an unskilled, esthetically challenged artist will do nothing
but make a mess given the artistic tools to work with. Lines will be
wrong, color choices horrid, forms muddled and warped. Conversely, that
same person can, without any effort or training, use the etch-a-sketch to
produce a perfectly straight, perfectly even line, and with only a little
practice will be able to produce simple but very clean drawings consisting
of vertical and horizontal lines.
Of course, an artist will be horribly constrained by the etch-a-sketch,
and will be able to create beauty using the brushes and paint.
Perl can be quite ugly when misapplied, or profoundly beautiful when
wielded with skill and talent. A 'diagonal language', indeed...
: I think a lot of the perception has something to do with regular
: expressions.
Regexes are a language within the language, of course.
: OK, I'm done venting. This thread has just brought up the frustration I
: sometimes feel when I'm working in other languages and I miss the
: simplicity, conciseness and beauty of Perl.
Language arguments are usually silly. To steal someone's analogy from the
other day, to answer 'which is faster, a porsche or a snowplow?', you need
to know something about the road conditions. :)
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "The hills are burning, and the wind is raging; and the clock
| strikes midnight in the Garden of Allah." - Don Henley
------------------------------
Date: Mon, 11 Dec 2000 22:06:51 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: Why do people think Perl is ugly? (Vent); was: Why isn't Perl highly orthogonal?
Message-Id: <YdcZ5.73104$IP1.2423223@news1.giganews.com>
cberry@cinenet.net wrote:
:
: I just hit the perfect analogy for Perl vs. orthogonal languages. Perl is
: a blank canvas, a set of brushes, and a palette of oil paints. Highly
: orthogonal languages are an etch-a-sketch.
I'll offer my Maggie if you may. I prefer to think of Perl as sexy
(flexible!) where I occassionally want its body (perly.y).
Saved by an Inanimate Carbon Rod Stewart!
--
Nate II
------------------------------
Date: Mon, 11 Dec 2000 19:20:54 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Why isn't Perl highly orthogonal?
Message-Id: <3a352916.4a2c$261@news.op.net>
In article <910ig2$qqs$1@boomer.cs.utexas.edu>,
Logan Shaw <logan@cs.utexas.edu> wrote:
>No, but an array is a string.
It most certainly is not.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Mon, 11 Dec 2000 19:45:08 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Why isn't Perl highly orthogonal?
Message-Id: <t3abm4sg2dr0a0@corp.supernews.com>
Michael Carman (mjcarman@home.com) wrote:
: Most of the responses have centered on your example, not the subject of
: your question. Perl is non-orthogonal by design. From 'perldoc perl'
:
: "The language is intended to be practical (easy to use,
: efficient, complete) rather than beautiful (tiny, elegant,
: minimal)."
The odd thing is that I used to be an orthogonality zealot, but have come
over time to regard Perl as beautiful.
To my way of thinking, Perl is nonorthogonal in many of the same ways and
for the same reasons that human languages are nonorthogonal. If I wish to
tell someone I am happy, I have an infinite number of ways to express
myself, from quasi-synonyms (happy|glad|joyous|pleased|...) to grammatical
arrangements (I am happy|I have been made happy|Happiness fills me). This
allows me to shade meanings and extra intentional layers into what I say.
I would once have been offended that Perl provides a grep built-in which
can be trivially implement in terms of map. Now, I see this as a very
useful semantic-level feature, a way to convey intention (to myself six
months from now, to maintenance programmers) and to express that intention
idiomaticly.
: IMHO, orthogonality is overrated. It sounds nice on the surface, but you
: invariably end up with a situation where you have to write some ugly
: hack to get around the restrictions of the language.
Amen. I'm reminded of a comparison I once heard between APL and LISP:
"APL is a flawless diamond, perfect, symmetrical, an irreducible whole.
But add anything to it, and it's ruined. LISP is a bucket of mud; add
anything to it, and it's still a bucket of mud."
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "The hills are burning, and the wind is raging; and the clock
| strikes midnight in the Garden of Allah." - Don Henley
------------------------------
Date: Mon, 11 Dec 2000 22:40:08 +0000
From: Greg Griffiths <greg2@surfaid.org>
Subject: Re: Win32::ODBC/MSAccess query
Message-Id: <3A3557C8.8F4AF155@surfaid.org>
You can, simply select the query in Access and then the SQL view, with a bit
of altering this will quickly give you the query for Perl.
rysmiel@my-deja.com wrote:
> In article <3A3000F1.FCAF4DB7@surfaid.org>,
> Greg Griffiths <greg2@surfaid.org> wrote:
> > why would you want to do this, I doubt that there would be any
> advantage
> > over recoding it your CGI script.
>
> The database with which I am working has about four years' worth of
> very complex queries, and my co-workers have strong preferences for
> keeping and using these which I'm not in a position to overrule.
>
> >
> > rysmiel@my-deja.com wrote:
> >
> > > Is it possible to call an existing queryin an MSAccess database from
> a
> > > perl script using Win32::ODBC, and if so what is the format ?
> > >
> > > Thanks in advance,
> > >
> > > E
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> >
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
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 V9 Issue 5084
**************************************