[11277] in Perl-Users-Digest
Perl-Users Digest, Issue: 4877 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 12 01:14:51 1999
Date: Thu, 11 Feb 99 22:01:25 -0800
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, 11 Feb 1999 Volume: 8 Number: 4877
Today's topics:
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Re: Perl Criticism topmind@technologist.com
Re: perl password example (Randal L. Schwartz)
Re: Perl tutorials?? <jcounts@voicenet.com>
PFR: UTC_to_Epoch (Larry Rosler)
Re: silly simple query <rick.delaney@home.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 12 Feb 1999 04:01:39 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <7a092u$7hl$1@nnrp1.dejanews.com>
In article <fl_aggie-2501990944540001@aggie.coaps.fsu.edu>,
fl_aggie@thepentagon.com (I R A Aggie) wrote:
> In article <78gpsb$qfq$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>
> + fl_aggie@thepentagon.com (I R A Aggie) wrote:
> + > topmind@technologist.com wrote:
> + > + dherriot@uk.oracle.com (Des Herriott) wrote:
> + > + > It's possible to write unmaintainable code in any language.
> + > + If I hear this flippen' MYTH
> + >
> + > Proof, please.
>
> + Mathematical?
>
> Not necessarily. But something other than PROOF BY ASSERTION, which is
> what the above quote is. If, say, Knuth say's its a myth, that would make
> me sit up and take notice...
>
> + > Show me a language that makes the programmer use _useful_ variable names.
> + > Show me a language that makes the programmer use subroutines and
functions.
> + > Show me a language that makes the programmer write comments as he goes
> along.
> + > Show me a language that makes the programmer write a manual.
>
> + These are only SOME of the total different ways to abuse
> + a language.
>
> Yes, and? in what ways do these abuses allow one to write maintainable
> code?
What? I don't understand.
>
> + Although I am not much of a Java fan, Java is much tougher to abuse than
> + Perl. There are no pointers and it is easy to tell what is
> + a function, a variable, an assignment, etc. There is also
> + less "hidden communication" between operations.
>
> And this prevents you from writing unmaintainable code how?
>
Why are you in an all-or-nothing mindset?
> + Pascal has similar properties.
>
> And pascal has been used in how many production products?
>
Delphi!
> James
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 03:58:50 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <7a08tm$7dt$1@nnrp1.dejanews.com>
In article <fl_aggie-2501990949580001@aggie.coaps.fsu.edu>,
fl_aggie@thepentagon.com (I R A Aggie) wrote:
> In article <slrn7anuqc.r09.sholden@pgrad.cs.usyd.edu.au>,
> sholden@cs.usyd.edu.au wrote:
>
> + The problem is that you restrict the good programmers the flexibility to
> + write good code. But you obviously don't care about this.
>
> topmind is probably _not_ a good programmer, which is why he wants his tools
> to protect him from himself.
>
> James
>
Insults aside, where is an example?
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 03:55:49 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <7a08o1$75l$1@nnrp1.dejanews.com>
In article <fl_aggie-1701992001430001@aggie.coaps.fsu.edu>,
fl_aggie@thepentagon.com (I R A Aggie) wrote:
> In article <77tffl$1ec$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>
> + I am talking about generalities. I have maintained many other's
> + code that clearly emphasized the short-term. Nobody ever
> + punished or "marked down" those guys.
>
> I take it that your supervisor never, ever gets on your case about how
> long your program is taking to write? I take it you've never been told
> that marketing promised something in two weeks, and they made the promise
> a week ago, so don't count on taking the weekend off?
You are assuming cryptic = speed
>
> So, what do _you_ do in that situation? tell 'em it can't be done? only
> to have them bring in someone else who's willing to do a hack, which
> happens to solve the problem (in this particular case).
>
> Guess who's going to be called "a team player" and "our go-to guy"?
>
> + The Dilbert strip is very popular because of
> + superficial management techniques, thus I am not alone
> + in this claim.
>
> No, the managment techniques aren't superficial. The managers, however,
> are. They have no understanding of what it is that they're managing, they
> want it done in the least amount of time, and since they don't have a clue,
> anything they don't understand must be easy.
>
> That isn't the fault of the programmers. That's a fault of a company so
> devoted to the bottom-line that they can't see tomorrow.
>
Fault or not, they do exist in abundence. You are focusing on
what should be while I am focusing on what is.
> Out of curiousity, have you looked at Ada?
>
Not common enuf. Nichy = big commute.
> James
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
[and you thot the thread was dead, ha ha]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 04:07:32 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <7a09dv$7lu$1@nnrp1.dejanews.com>
In article <x73e52vemk.fsf@home.sysarch.com>,
Uri Guttman <uri@home.sysarch.com> wrote:
> >>>>> "t" == topmind <topmind@technologist.com> writes:
>
> t> In article <x7u2xmv444.fsf@home.sysarch.com>,
> t> Uri Guttman <uri@home.sysarch.com> wrote:
>
> t> My claim is that most of the twistability in Perl can be eliminated
> t> without a great loss of productivity. If I provide an example,
> t> someone would eventually find a different way to do it and say
> t> "but you did not have to do it that way."
>
> well show us the code. just once, post some actual godfuckingdamn
> code. you have not posted 1 single character of legal perl code. not 1!!
>
> t> Are you saying that you cannot take the challenge I gave?
> t> Regardless of my actions or alleged failings, you
> t> have failed the test. Rather than fuss over the
> t> source of the test, just take the darned test.
>
> what challenge? to correct your misbegotten views. i am not here to do
> that. we have no problem with your thinking perl can be saved. you are
> the minister of programming and perl is a sinner of languages. let us
> pray tpgether that all of perl's followers can be washed of their
> sins. (i just saw the apostle on cable :-).
>
> t> Seen your way, I am one person who failed. However,
> t> yous are many people who failed.
>
> yous? whose yous dos yous means? i don't consider myself or perl or the
> perl community a failure. it is the language which holds the web and
> much of the net together.
That must be why I get so many "Server returned extended information" errors.
>
> t> Where is it stated that only Perl lovers can come here?
> t> (P.S. I am not a Perl hater, dispite the heat in here.)
>
> nowhere. but you have to talk the language itself which you consistantly
> refuse to do. you babble about your theories as if they came from god
> (there goes that analogy again) and we must be converted. well, bub,
> maybe you are wrong. your religion could be barking up the wrong
> god. you cannot save anyone from themselves via religion, legislation or
> programming restrictions. that has been proven many time by hundreds or
> thousands of each. humankind will always find a way to screw up. live
> with it.
>
> t> I have refuted this "equal abusability" claim several
> t> times in detail. You have not addressed
> t> the details of my refutation.
>
> equal mean nothing. at any given level of restriction, you screw up at
> that level so stop the quest for the holy grail of languages. it is
> futile and you will just die an unhappy idiot. oh, you are one now? so
> won't you please die for us? or at least leave this group already.
>
> t> Lump all things you hate together. Typical of humans.
>
> and you are above being human? oh, i forgot, you are the emissary of
> god's programming language. call it genesis, and bottomind said let ther
> be no flexibilty, andonly one way of doing anything. no pointers,
> references, structures, objects, etc. we will all cross the jordan
> writing cobol and fortran for ever and ever, amen!!
>
I did not promote Cobol and Fortran. None of you mouths can
show one single fricken peice of code that shows why
Perl's funkiness is so important to keep.
> boy that movie sure affected me and i am jewish!
>
> say amen bottommind, say amen!!
>
> uri
>
> --
> Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
> Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
> uri@sysarch.com ------------------------------------ http://www.sysarch.com
> The Best Search Engine on the Net ------------- http://www.northernlight.com
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 04:10:47 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <7a09k2$817$1@nnrp1.dejanews.com>
In article <787tcs$150$1@nnrp1.dejanews.com>,
droby@copyright.com wrote:
> In article <786dsn$o0l$1@nnrp1.dejanews.com>,
> topmind@technologist.com wrote:
> > > And topmind's logic is bad enough that we don't need to resort to that.
> >
> > Okay, my spelling is "excessively phonetic", but
> >
> > Give one example of bad logic!
> >
>
> X can be used to create something bad, therefore X is bad.
>
> Seems to me to summarize all your points succinctly.
>
Correction: If population Y tends to abuse X, then X
should not be used by population Y.
> --
> Don Roby
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/lantopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 04:14:26 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <7a09qs$82f$1@nnrp1.dejanews.com>
In article <x7zp7atzue.fsf@home.sysarch.com>,
Uri Guttman <uri@home.sysarch.com> wrote:
> >>>>> "t" == topmind <topmind@technologist.com> writes:
>
> t> You guys are kind of controdicting each other. Some
> t> claim I am falsely taking credit for existing (implemented)
> t> ideas, and others are chewing me out for not implimenting
> t> them.
>
> your just proving how smallminded (sic) you are. those are not
> contradictory. stealing ideas about languages and espousing a hodgepodge
> of them and the end all philosophy is one thing, and implementing that
> pile of junk into an actual runnable system is another. you have done
> the former and not (and never will) the latter.
>
> uri
>
The best thinkers and designers are rarely the best implementors.
This is true of animation, architecture, music, etc.
Why are languages and interpreters immune?
> --
> Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
> Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
> uri@sysarch.com ------------------------------------ http://www.sysarch.com
> The Best Search Engine on the Net ------------- http://www.northernlight.com
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 04:23:32 GMT
From: topmind@technologist.com
To: staffan@ngb.se
Subject: Re: Perl Criticism
Message-Id: <7a0abs$8hl$1@nnrp1.dejanews.com>
[posted]
In article <36A4C4A3.79F0EA81@ngb.se>,
Staffan Liljas <staffan@ngb.se> wrote:
> topmind@technologist.com wrote:
>
> > But I see Perl code that tries to do what are really "table-oriented"
> > operations. It can be done in Perl with enough operations,
> > but it is hard for me to believe that table-orientedness is
> > Perl's strength.
>
> No, maybe not. But I don't think that this is perls fault, if indeed it
> is a fault. I assume Visual Objects would be considered table-oriented,
> and in observing what it really does, with its database servers etc,
> when looking behind the scenes, it's all done with objects and
> inheritance. And this could clearly be done in perl too. However, maybe
> noone has wanted to create the corresponding objects in perl.
Objects are not the most succint way to do tables IMO.
> Why, may
> one ask? Maybe because perl-programmers prefer not using xbase
> databases,
The database engine or format is not really the issue.
> which is the basis of at least Visual Objects, and several
> other TOPs. Why is this? I think the reason is that perl-programmers in
> general prefer to work with SQL.
No, Perlers tend to use memory pointers because SQL is
too formal and set-oriented for many tasks.
>
> Now you may ask: Why isn't there any dataservers in perl for SQL
> databases, as there is in, for example, Visual Objects? The reason, if
> you ask me, is that SQL and other so called relational databas models
> don't lend themselves well to database server objects of this type.
> Instead you use session objects etc, which, in fact, makes more sense.
I am not quite sure what you mean here.
>
> Staffan
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 11 Feb 1999 21:17:36 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: perl password example
Message-Id: <m1yam4dwun.fsf@halfdome.holdit.com>
>>>>> "Bob" == Bob Walton <walton@frontiernet.net> writes:
Bob> Paul, the salt value is chosen randomly. There are two printable
Bob> characters in the salt, for 4096 possible salt values.
I presume you mean "Two characters from the set of [a-zA-Z0-9/.]",
but you didn't say that, and I want to make sure that everyone playing
along at home knows what you mean too.
print "Just another Unix security guy and Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 11 Feb 1999 23:26:06 -0500
From: "John Counts" <jcounts@voicenet.com>
Subject: Re: Perl tutorials??
Message-Id: <7a0avi$66s$1@news1.fast.net>
Theres lots of them at http://reference.perl.com
Bill Garrett wrote in message <36C3B984.3FCB4BF3@hamilton.net>...
>I am looking for a good free perl tutorial.
>Anyone know wherer I can get one form?
>Jason@wbdet.com
>
------------------------------
Date: Thu, 11 Feb 1999 17:46:34 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: PFR: UTC_to_Epoch
Message-Id: <MPG.112d27d35a79a401989a24@nntp.hpl.hp.com>
In article <m3d83g92nf.fsf_-_@moiraine.dimensional.com> on 11 Feb 1999
12:11:16 -0700, Daniel Grisinger <dgris@moiraine.dimensional.com>
says...
> lr@hpl.hp.com (Larry Rosler) writes:
>
> > What I would like to see is a dynamic on-line equivalent of the kind of
> > code published in The Perl Cookbook, contributed to and reviewed
> > collaboratively, and with a searchable index.
So it's appropriate that I submit one of the first functions. I have a
couple of others to come, including light-weight versions of strftime
(time to formatted date/time) and its inverse (formatted date/time to
time).
As ground rules, I suggest that all functions be '-w' and 'use strict;'
compliant. Lines should fit without folding; tabs should be avoided.
Documentation is 'good', but test code might not be necessary, to keep
the volume down.
As you can see, the setup and argument checking for this function are
trivial but space-consuming. The guts of the algorithm is also
'trivial', but quite inscrutable (to me). Comments, suggestions, and
brickbats are welcome, of course!
> Have the appropriate amount of fun.
You bet! Thanks for setting this up. Links to the Repository need to
be created from http://www.perl.com/ and other appropriate places, of
course.
*********************************************************************
#!/usr/local/bin/perl -w
use strict;
# UTC_to_Epoch: Convert UTC date/time to Unix-epoch time.
# Larry Rosler, 11 February, 1999
# UTC_to_Epoch converts a broken-down date/time array from UTC to time
# in seconds since the Unix Epoch (midnight on 1 January, 1970). It is
# essentially the inverse of gmtime.
# The input is a list of at least three integers:
# year [1970 to 2099]
# month [1 to 12]
# day [1 to whatever is appropriate for the year and month]
# hour [0 to 23; 0 if omitted]
# minute [0 to 59; 0 if omitted]
# second [0 to 59; 0 if omitted]
# 'undef' is returned if the arguments do not represent a valid
# date/time on or after the Unix Epoch.
sub UTC_to_Epoch {
my ($year, $mon, $day, $hour, $min, $sec) = @_;
defined $year && defined $mon && defined $day or return;
my @m_day = (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
$m_day[2] = 29 unless $year % 4; # OK from 1901 through 2099.
1970 <= $year && $year <= 2099
&& 1 <= $mon && $mon <= 12
&& 1 <= $day && $day <= $m_day[$mon]
&& 0 <= ($hour ||= 0) && $hour <= 23
&& 0 <= ($min ||= 0) && $min <= 59
&& 0 <= ($sec ||= 0) && $sec <= 59 or return;
# Adapted from Astronomical Computing, Sky & Telescope, May, 1984.
24 * 60 * 60 * (367 * $year - 678972 - 40587 + int(275 * $mon / 9) +
$day - int((int(int($year + ($mon < 9 ? -1 : 1) *
int(abs($mon - 9) / 7)) / 100) + 1) * 3 / 4) -
int(7 * (int(($mon + 9) / 12) + $year) / 4)) +
60 * 60 * $hour + 60 * $min + $sec
}
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 12 Feb 1999 04:24:45 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: silly simple query
Message-Id: <36C3AEED.ADE9822E@home.com>
Gavin Cato wrote:
>
> What would be the perl equivalent of
>
> cat $filename | grep $variable | wc -l
perl -e 'for (grep(/var/, map($_, <>))) { $c++ } print $c' file
Notice the useless use of map to correspond to the cat. Also I'm not
using grep's ability to count either.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4877
**************************************