[13111] in Perl-Users-Digest
Perl-Users Digest, Issue: 521 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 14 02:17:16 1999
Date: Fri, 13 Aug 1999 23:10:11 -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 Fri, 13 Aug 1999 Volume: 9 Number: 521
Today's topics:
Re: Why use Perl when we've got Python?! (Sam Holden)
Re: Why use Perl when we've got Python?! <tchrist@mox.perl.com>
Re: Why use Perl when we've got Python?! (Sam Holden)
Re: Why use Perl when we've got Python?! <rra@stanford.edu>
Re: Why use Perl when we've got Python?! <rra@stanford.edu>
Re: Why use Perl when we've got Python?! <rra@stanford.edu>
Re: Why use Perl when we've got Python?! <rra@stanford.edu>
Re: Why use Perl when we've got Python?! <rra@stanford.edu>
Re: Why use Perl when we've got Python?! <rra@stanford.edu>
Re: Why use Perl when we've got Python?! <meowing@banet.net>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Aug 1999 04:08:05 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9qu0.pu8.sholden@pgrad.cs.usyd.edu.au>
On Sat, 14 Aug 1999 03:18:19 GMT,
John Stevens <jstevens@bamboo.verinet.com> wrote:
>On 14 Aug 1999 02:39:10 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>>On 13 Aug 1999 20:05:12 -0700,
>> John W. Stevens <jstevens@basho.fc.hp.com> wrote:
>><snip>
>>>
>>>Thanks for the two missing magic characters (@$, and =>). I always
>>>have to look them up.
>>
>>Learn some perl then. @ is pretty fundamental. $ is pretty fundamental.
>>What happens when you tell a scalr to be an array is pretty fundamental.
>
>Oh, I *KNOW* the semantic. I just can't remember the syntax.
>
>As for calling the conversion of a scalar to an array "pretty
>fundamental". . . can you say "Extreme Exageration"?
>
>Tom tells me that Perl doesn't exclude non-computer scientists,
>then you guys start throwing around references to references. . .
That could simply have been a reference. Or a symbolic reference.
What is fundamental is that a @ tacked on the front indicates that it is an
array. So given @$fred, even with no knowledge of what that exactly means
you should be able to tell that it is somehow treating $fred as an array.
>
>:-)
>
>>Only if you don't know perl.
>
>No, it is confusing to the average programmer. If it isn't
>confusing, to you, then you've spent a *LOT* of time learning
>and using Perl.
>
>>$dict is a scalar. %dict is a hash. In that
>>example a scalar was used.
>
>Yes. . . is it a hash, or a scalar? If it is a scalar, why
>is it called dict? If it is a hash, then why is it prefixed
>by $? If this is a reference instead of a scalar, then why
>doesn't it have it's own special prefix character. ;->
It's a scalar. It is named dict because TomC called it that. It is
also named that since it is a reference to a hash. I use code like this
in C quite a bit :
Tree *tree;
Even though tree isn't a tree, but a pointer to a tree. If you don't like
that then don't use it. It's a fairly common thing to do though, I've seen
it used in pascal, C and C++, so it is not unique to perl.
>
>>At least in the discussions I have with people about python I don't
>>complain about python syntax I don't understand I just ask what it means.
>
>I am not complaining about syntax I don't understand. I am complaining
>about syntax that is unecesarily difficult to learn, remember, and use.
>
>>Instead of calling it confusing people who actually want to learn something
>>ask what it means, and why it is so. You obviously don't want to
>>learn but only to criticise. That's fine but it would be better to just
>>post to the python group...
>
>What, you believe that you are a mind reader?
>
>You are wrong. I know what the syntax means. I criticize because
>it is indeed confusing, and difficult to remember.
If you know what it means then why do you continually get it wrong
throughout this thread?
>
>>You can write Perl programs that resemble sed, or awk, or C, or Lisp, or
>>Python. This is Officially Okay in Perl culture.
>
>You cannot write Perl that resemble Python. You are required to
>use curly braces as block delimiters.
In fact you are not. You are wrong yet again. Actually thinking about how
perl works for a minute would show you that perl is in fact flexible.
it is not a lie when people say perl doesn't force you to write a
particular way.
Here is some code from Damian Conway from the 'Impythonating PERL' thread
in march.
package impythonate;
use Text::Tabs;
my ($active, @bracket) = (0, ('{', ';', '}') );
sub import
{
return 1 if ($active++);
open CODE, $0 or die "couldn't translate $0";
my ($code, $transcode, $lastindent) = (join('',<CODE>), '');
$code =~ s/\\\n/ /g;
foreach (split /\n/, $code)
{
my ($indent,$notempty) = /\A([ \t]*)(\S?)/;
$indent = length(expand($indent));
$transcode .= $bracket[1+($lastindent<=>$indent)]
if $notempty && defined $lastindent;
$transcode .= "$_\n";
$lastindent = $indent if $notempty;
}
eval $transcode and exit or die $@;
}
1;
And here is his sample code that is now valid perl (although anyone who uses
it for real code should be killed) :
#Now newlines replace colons and indentation replaces brackets:
use impythonate; # STILL NEED THAT ONE SEMICOLON, DAMMIT!
for $i (1..10) # COMMENTS ARE OKAY
print "$i: "
my $isq = \
$i **2 # LINE CONTINUATIONS WORK AS IN PYTHON
print " $isq\n"
print "done\n"
--
Sam
Basically, avoid comments. If your code needs a comment to be
understood, it would be better to rewrite it so it's easier to
understand. --Rob Pike
------------------------------
Date: 13 Aug 1999 22:09:28 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <37b4ebf8@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Chad Netzer <chad@vision.arc.nasa.gov> writes:
:PS. I find Tom's Python criticisms a bit off base, at times, but they
:are mostly valid answers to the original question, and certainly not
:inappropriate for c.l.perl.m.
I answer the question put to me.
:However, Tom also has books to sell, and
:that end is not achieved by turning people away from Perl. Just
:consider that when interpreting his criticisms.
Fuck that noise. The day I am not technically credible is the
day I quit.
And you should search deja news for how often I use such language.
I can think of nothing lower than to accuse me of selling out. I am
extremely offended. Perhaps you're confusing me with someone else.
--tom
--
Thou shalt run lint frequently and study its pronouncements with care, for
verily its perception and judgement oft exceed thine.
--1st commandment for C programmers
------------------------------
Date: 14 Aug 1999 04:18:35 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9rhm.pu8.sholden@pgrad.cs.usyd.edu.au>
On Sat, 14 Aug 1999 03:58:25 +0000,
Chad Netzer <chad@vision.arc.nasa.gov> wrote:
>
>PS. I find Tom's Python criticisms a bit off base, at times, but they
>are mostly valid answers to the original question, and certainly not
>inappropriate for c.l.perl.m. However, Tom also has books to sell, and
>that end is not achieved by turning people away from Perl. Just
>consider that when interpreting his criticisms.
Do you often make such serious accusations against people without
providing any evidence at all. There are times that Tom seems to go
a little over the top to me, but they are almost always to do with usenet
etiquite and intelligence theories. I have never seen any evidence of him
trying to up his book sales in a deceitful manner.
--
Sam
these days you're allowed to patent natural laws, and even other people's
genomes.
-- Tom Christiansen in <374b0ddd@cs.colorado.edu>
------------------------------
Date: 13 Aug 1999 21:31:27 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <ylpv0rj84g.fsf@windlord.stanford.edu>
Ian Clarke <I.Clarke@NOSPAM.strs.co.uk> writes:
> I have, however, noticed a difference in perspective, which probably
> typifies a split in opinion going through most of computer science. The
> Python advocate is willing to tolerate limits placed on what they can do
> and write if it means that it makes code more readable for others, and
> other's code more readable to them (trusting Guido to make intelligent
> decisions on their behalf). The Perl advocate feels that if the
> language could have a given feature, then it should. They have no time
> for anyone to tell them what they should and shouldn't do while coding.
That's an incredibly biased way of trying to express your point. At least
say that the Python advocate is willing to tolerate limits placed on what
they can do and write if *they think* it makes code more readable for
others *who don't know the language as well as they do*, if you're trying
for any shred of objectivity.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 13 Aug 1999 21:38:54 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <yln1vvj7s1.fsf@windlord.stanford.edu>
Tom Christiansen <tchrist@mox.perl.com> writes:
> What's a "scripting" language, for goodness sake?
It's a programming language with high-level constructs for glue
applications, a programming language that can easily embed other languages
and be embedded in other applications, which can easily talk to processes,
pipes, and network sockets, and which has dynamically resizeable data
structures including strings.
Those are the characteristics that seem common across all of Tcl, Perl,
Python, and the other languages normally called scripting languages, but
have no native support in C and C++.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 13 Aug 1999 21:40:58 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <ylk8qzj7ol.fsf@windlord.stanford.edu>
John W Stevens <jstevens@basho.fc.hp.com> writes:
> Do you write C like:
> long doi(int c,long d){int i;printf("This is valid
> C!\n");d=c+d;for(i=c;i<d;i--)printf("%d", i);return d;}
> Or do you write it thusly:
> long
> doi(
> int c,
> long d)
> {
> auto int i;
> printf("This is valid C!\n");
> d = c + d;
> for (i = c; i < d; i--)
> printf("%d", i);
> return d;
> }
Neither. I write it like:
long doi (int c, long d)
{
int i;
printf ("This is valid C!\n");
d = c + d;
for (i = c; i < d; i--) printf ("%d", i);
return d;
}
and don't want to have to worry about whether the differences between
yours and mine are going to cause the code to compile to a completely
different program.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 13 Aug 1999 21:43:21 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <ylhfm3j7km.fsf@windlord.stanford.edu>
John W Stevens <jstevens@basho.fc.hp.com> writes:
> Tom Christiansen wrote:
>> You think that's rich, you ought to see what happens to people who set
>> their tabstops to 3 or 4. :-)
> I set *MY* tab stops to three or four. No problems. . . but of course,
> I don't let my prejudices get the better of me.
I hope your editor doesn't insert literal tabs. People who use tab stops
other than eight and actually insert literal tabs, which they then think
represent four spaces despite the fact that the whole rest of the world
will see them as eight, have a circle of hell reserved for them.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 13 Aug 1999 21:48:00 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <yld7wrj7cv.fsf@windlord.stanford.edu>
John Stevens <jstevens@bamboo.verinet.com> writes:
> Nor are we talking about me. However, the ability to become a "Good
> Python Programmer" with much less time than it takes to become a "Good
> Perl Programmer" is, in itself, a comment on Perl.
It's even easier to become a Good Logo Programmer.
> The learning curve for Perl is steeper and longer than that of Python.
Once you apply some basic geometry to that, that's a rather strong
endorsement of Perl for a programmer who is willing to invest the time to
learn his tools.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 13 Aug 1999 21:52:47 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <ylaervj74w.fsf@windlord.stanford.edu>
John W Stevens <jstevens@basho.fc.hp.com> writes:
> Consider using the Perl module for FTP operations that *DON'T* conform
> to standard usage. . .
If they're not part of standard usage, they're not FTP. FTP is a
protocol, not an arbitrary collection of commands that people feel like
putting on a server. If you want to do things that aren't part of the
protocol, Net::Cmd (which Net::FTP inherits from) is sitting right there
to help you and works just fine.
And the person who is just looking for an FTP module doesn't have to care
about or see it.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 14 Aug 1999 01:36:44 -0400
From: meow <meowing@banet.net>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <87aeruvs7n.fsf@slip-32-100-202-195.ma.us.ibm.net>
Russ Allbery <rra@stanford.edu> wrote:
> John Stevens <jstevens@bamboo.verinet.com> writes:
>> The learning curve for Perl is steeper and longer than that of Python.
> Once you apply some basic geometry to that, that's a rather strong
> endorsement of Perl for a programmer who is willing to invest the time to
> learn his tools.
It would be, if one presumes that Stevens' statement can be taken at
face value. It can't. Python's got plenty of subtlety and complexity
of its own, just in different places. It's a bit like Smalltalk in
that regard: the mechanics of the language will fit on a postage
stamp, and you might even limp by with that minimum of knowledge; but
if you want to do things well you're going to have to dig in and learn
the nuts and bolts of the extensive class library. Call it a hidden
learning curve, I suppose, but it's there and very real.
I happen to prefer working in Python whenever I can, but it's not that
Perl is a bad language. The problem is really with me; I've got a
very cluttered mind, and Perl is just a little *too* willing to
accommodate =) Python's dispositon toward little containers happens to
work as a nifty organizational tool in my case; but it would be silly
to generalize that into saying that it's a feature everyone wants
(yeesh, I *hope* there aren't too many people who think the way I do,
or the world's in Big Trouble) or needs for every application.
------------------------------
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 521
*************************************