[13109] in Perl-Users-Digest
Perl-Users Digest, Issue: 519 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 14 00:07:45 1999
Date: Fri, 13 Aug 1999 21:05:07 -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: 519
Today's topics:
Re: Bits and Bytes ... <hedin@wizcom.ru>
Re: I guess this is a Misc question: Cgi-bin (J. Moreno)
Re: Perl Programmers' Web Design "Difficulties" (Benjamin Franz)
Re: Perl Programmers' Web Design "Difficulties" (Randal L. Schwartz)
Re: Perl vs. ASP: which is better? (Kent Delcastillo)
Re: Perl/TK issues <ltl@rgsun5.viasystems.com>
Re: What happened to Perl in 1990? <elaine@chaos.wustl.edu>
Re: Why use Perl when we've got Python?! (John Stevens)
Re: Why use Perl when we've got Python?! (John Stevens)
Re: Why use Perl when we've got Python?! (John Stevens)
Re: Why use Perl when we've got Python?! (John Stevens)
Re: Why use Perl when we've got Python?! (Sam Holden)
Re: Why use Perl when we've got Python?! (John Stevens)
Re: Why use Perl when we've got Python?! (John Stevens)
Re: Why use Perl when we've got Python?! (John Stevens)
Re: Why use Perl when we've got Python?! <chad@vision.arc.nasa.gov>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 14 Aug 1999 12:27:45 +0900
From: "Victor Alekhin" <hedin@wizcom.ru>
Subject: Re: Bits and Bytes ...
Message-Id: <37b4e19e.0@news.irtel.ru>
Bart Lateur <bart.lateur@skynet.be> сообщил в новостях
следующее:37b449a1.1136068@news.skynet.be...
> Victor Alekhin wrote:
>
> >Is it possible to write a perl script that
> >will make something like:
> >
> > mov al,ByteData
> > xor al,255
> > mov cx,8
> > @1: rcl al,1
> > rcr ah,1
> > loop @1
> > mov ByteData,ah
Thanks All, one more NT-box moved in UNIX ...
------------------------------
Date: Fri, 13 Aug 1999 23:48:24 -0400
From: planb@newsreaders.com (J. Moreno)
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <1dwi1ds.1n3prm812d6vb2N@roxboro0-0034.dyn.interpath.net>
Ben Quick <newsgroup@bigwig.net> wrote:
> J. Moreno wrote in message
> >Ben Quick <newsgroup@bigwig.net> wrote:
> >
-snip-
> >> The general part is very none specific. Maybe a re-wording is on order?
> >
> >Possibly so -- and I have a suggestion to send to them for doing so, if
> >I don't forget.
>
> That's a good idea. If you remember, as you say
Well, just as importantly I've sent a note to the person doing the
newsgroup faq that it should be crossposted to news.answers.
> >-snip-
> >
> >There's another faq just for the group, but it should be referenced by
> >that page (one of the things I'm going to suggest).
>
> A point to note. As a generalization, most people will not visit a page to
> read a faq
The faq is posted here, I'm just saying that the perl faq should have a
reference to it (there's a number of ways that'd be possible, but the
easiest is if it gets crossposted to news.answers and forwarded to the
faq archives).
-snip-
> >It also implies that the way to find out that a question is off topic is
> >to post it and then see from the responses.
>
> But the responses should in turn tell the poster what to do in future
A flame for being OT does tell you what to do, indirectly -- be sure
your post is on topic next time.
> >You should be fairly sure that the question is on topic before asking it
> >-- and if you know it isn't or that it may not be, then be prepared to
> >accept the flames that will garner you in good grace.
>
> Why should anyone get flamed for a misunderstanding\lack of knowledge
Because a poster is responsible for learning what is acceptable before
posting. A newsgroup is a community, before posting/joining a person
has an obligation to learn what the it's customs/rules are.
-snip-
>
> >but /they/ didn't have an obligation to give you a polite answer.
>
> Can't agree with that. Just because someone get's something wrong doesn't
> mean that you should be abusive towards them. Ok, so you don't /have/ to be
> polite, but when has being polite harmed anyone?
When the someone takes it as sign of weakness and attacks?
And of course there's always the "He was rude first" defense -- posting
OT is rude, so they feel justified in being rude back.
--
John Moreno
------------------------------
Date: Sat, 14 Aug 1999 03:53:42 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: Perl Programmers' Web Design "Difficulties"
Message-Id: <aL5t3.494$bZ1.46109@typhoon01.swbell.net>
In article <37B4DB27.158F2282@gethits.com>, <support@gethits.com> wrote:
>
>
>support@gethits.com wrote:
>
>> (when appropriate).
>
>Lack of graphics/design is appropriate for content rich
>site (CPAN, et al). Graphics are appropriate if shopping online
>for, say, a condo or car...a picture tells a thousand words.
>IMHO. Darryl.
Mmmmm...Living on *both* sides of the fence as I have for the last
five years, I have to disagree. Graphics and design are *part* of
effective communication. It is a fundamental error to believe
that presentation *can* be 100% seperated from content. In some
degree, presentation is *part* of content. Which is not to say
that I don't think it is a good thing to seperate content from
information *internally* for processing as much as possible. But
for human consumption - the two are inseperable. If you don't think
so - how about we start delivering your morning paper on microdots?
A well designed site adds to speed of location of information.
A poorly designed one makes you plow through poorly organized and
presented information to find the parts you want. CPAN is an example
of a place where some design improvement would significantly improve
usability. The links frequently frustrate rather than assist in
information location. An example of this is the 'Modules by Category'
area. That section is potentially the best way to find what you are
looking for, and utterly unusable in practice since it links to
the 'whois' list rather than to the modules.
Graham Barr's new 'search' area has some real potential for improving
that situation, fortunately. And it looks nice to boot. The two
are not completely unrelated.
--
Benjamin Franz
------------------------------
Date: 13 Aug 1999 20:58:32 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl Programmers' Web Design "Difficulties"
Message-Id: <m1k8qzypw7.fsf@halfdome.holdit.com>
>>>>> "revjack" == revjack <revjack@radix.net> writes:
revjack> :http://www.stonehenge.com
revjack> One of my favorite sites. I can find what I'm looking for
revjack> right away. What higher praise can there be?
Thank you!
And I *have* been slowly changing it to add menus on the left of all
the important pages.
But in response to the troll :), I believe content is more important
than flash-n-sizzle. I also believe in accessibility. It wasn't
until three months ago that I finally decided to leave non-table
browsers in the dust.
I'll never use frames, unless a non-frame version with the same
content is clearly present. And I'm still not convinced frames ever
offer any advantage. After all, you can't bookmark the durned things,
and the indexing engines hate them.
I'll never use image maps unless non-graphic browsers are provided an
alternative.
I'll *never* use java or javascript, because the security implications
are too nasty (and they get stripped at many corporate firewalls).
I'll never use flash or shockwave. Much more sizzle than steak.
I may someday use style sheets, but only if the same page looks OK
with style sheets turned off.
I'll never use cookies for long-term authentication.
And contrary to what was said, I think the new www.perl.com looks
HORRIBLE. The characters are far too small on my browser, and
changing the settings doesn't seem to change the size.
Bad design. Very bad design. And completely ADA-non-compliant. (You
can get into legal trouble for that, you know.)
These are all things that irk me about the "media wranglers" that are
trying to take over the net.
I refuse to be one of them.
And which would you rather have me spend time in? Emacs, or Photoshop?
:-)
print "Just another Perl website creator,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: 14 Aug 1999 03:00:03 GMT
From: delcasti@cs.fsu.edu (Kent Delcastillo)
Subject: Re: Perl vs. ASP: which is better?
Message-Id: <7p2m3j$nee$1@news.fsu.edu>
I'm the opposite of yourself. I have lots more experience with PERL, as a
result of a class at Florida State University. We created gifs, did database
stuff (with local files and with sql), and other PERL stuff. I still screw
up the terminology (i.e. Perl vs. ASP instead of CGI vs. ASP). I also
know, or am getting to know, both C\C++ and Java (does anyone truly
'know' it?). But I really don't know VB or ASP and have decided to teach
myself via the Wrox books. Plus, my part-time job is pro-Microsoft with a
full-time VB-programmer on staff. We are now playing with MS-SQL7 and IIS4
so they are all for ASP and anti- anything else (I've already done an
unsuccessful song and dance for PERL which, I've read, runs "dog slow" on
MS stuff anyway).
My biggest beef with ASP so far is that if I were in PERL, I could write
one .pl file that could handle all requests and output. In ASP, I have to
write multiple ASP pages resulting in much duplication. Is this correct,
or am I confused once again with the whole MS-VB-ASP-AEIOU *stuff*?
"Tom Dominico, Jr." wrote:
: I started programming in VB, carried that over to ASP (VBScript), and
: I've recently started to dabble in Perl/CGI programming on IIS. I do
: _not_ have a great deal of experience in it though...so, I think I can
: identify with you. I don't know if you've done much programming in
: Perl,
: but I started to get a real appreciation for it very quickly. VBScript
: simply doesn't compare. Yes, it is easier to learn/less cryptic,
: but...
: I would recommend that you at least give it a try. I believe it never
: hurts to learn something new, anyway, and knowing Perl certainly won't
: hurt you.
: ==============================
: Tom Dominico, Jr.
: Email: news@tomd.org
: <Insert clever witticism here>
: ==============================
--
Kent Del Castillo
kent@kentd.com
------------------------------
Date: 14 Aug 1999 03:19:05 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: Perl/TK issues
Message-Id: <7p2n79$l0e$2@rguxd.viasystems.com>
In comp.lang.perl.misc Donovan Rebbechi <elflord@news.newsguy.com> wrote:
[snip]
:>I am currently coding something which is about 1000 lines at this
:>stage, and the naming conventions make it difficult to write
:>clean code ( eg in tcl, you have a naming scheme that reflects
:>the widget heirarchy, in perl you don't. )
Umm. You can if you want.
:>My reason for wanting to build the widget heirarchy into variables is
:>because passing widgets to subroutines is very tedious otherwise,
:>and you also run out of names for all those widgets (-; My current
:>attempt at an answer has been to use anonymous hashrefs to build
:>a data structure mirroring the structure of a widget tree. This
:>helps, but is still a tad cumbersome.
[snip]
Perhaps you can read more about closures and lexical scoping.
You may not need to keep track of your widgets the way you
think you do. OTOH maybe I don't really understand the problem
you are trying to solve.
Rather than asking to see some code, why not post some that
demonstrates your concern with name space and passing to subroutines
and see if we can help.
--
// Lee.Lindley /// Programmer shortage? What programmer shortage?
// @bigfoot.com /// Only *cheap* programmers are in short supply.
//////////////////// 50 cent beers are in short supply too.
------------------------------
Date: Fri, 13 Aug 1999 23:13:06 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: What happened to Perl in 1990?
Message-Id: <37B4DEB5.E81AA04A@chaos.wustl.edu>
brian d foy wrote:
> looking over e.'s Perl Timeline
> <URL:http://history.perl.org/PerlTimeline.html#1990s> i see that
> there is nothing significant listed for the year 1990. surely
> something must have happened that year, but that's before i had
> heard of Perl...
Well, Perl was very young, the web wasn't around yet and these factoids
are much harder to find. Larry did offer me his archive to peruse which
I will revisit soon and hopefully find some interesting stuff for the
early 90s. Also, when I was researching all of this stuff, it was like a
rabbit hole....days were spent on some things. The internet is not for
the easily distracted or entertained on a mission with a deadline :)
Polishing and refinement are in the plan.
e.
------------------------------
Date: Sat, 14 Aug 1999 03:08:33 GMT
From: jstevens@bamboo.verinet.com (John Stevens)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9nde.h3c.jstevens@bamboo.verinet.com>
On 14 Aug 1999 02:32:12 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>On 13 Aug 1999 20:04:03 -0700, John W. Stevens <jstevens@basho.fc.hp.com> wrote:
>>> In comp.lang.perl.misc,
>>> "John W. Stevens" <jstevens@basho.fc.hp.com> writes:
>>> :$b[ 2 ] = $c;
>>> :
>>> :> That's just fine in Perl. It's not fine in Python, because Python
>>> :> won't automatically grow an array.
>>> :
>>> :'Cause it doesn't have arrays (or, at least, not built in ones).
>>>
>>> Gosh, that's a feature. NOT.
>>
>>Perl doesn't have lists. Python doesn't have built-in arrays.
>
>You should learn some perl you now..
>
>@array = (1,10,20,30);
>$from_list = (1,10,20,30);
>$from_array = @array;
>print "$from_list\n$from_array\n";
>
>Will output :
>30
>4
The @ prefix denotes an array. You, yourself, should learn
Perl. Calling an array a list, doesn't make it one.
>Perl has lists,
Not built in, it doesn't, unless you define array and list as being
different words for exactly the same type/class.
>if you know perl you would know this.
I know Perl. You need to learn Python.
>If you program in perl
>and don't know this, then you must get very very confused at times.
If @ denotes list, then the following Perl would be illegal:
@ary = (1, 2, 3);
@ary[5] = "Test";
But, obviously, this is not illegal.
>>I will assume that a list module is available for Perl.
>
>No it is one of the built in bits... like hashes and arrays.
Really? What is the prefix character that denotes a list?
>>I wasn't trying to compare features, I was simply pointing out
>>that your comparison was Apples and Oranges, and therefore at
>>least somewhat invalid.
>
>Only because you have no idea what you are talking about.
:-)
Coming from somebody who doesn't know the difference from *EMULATING*
a list with an array, vs. a real array, that is a good one!
Now I suppose that you will tell me that Perl has stacks, too!
;->
John S.
------------------------------
Date: Sat, 14 Aug 1999 03:18:19 GMT
From: jstevens@bamboo.verinet.com (John Stevens)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9nvr.h3c.jstevens@bamboo.verinet.com>
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. . .
:-)
>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. ;->
>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.
>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.
John S.
------------------------------
Date: Sat, 14 Aug 1999 03:33:52 GMT
From: jstevens@bamboo.verinet.com (John Stevens)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9ot0.h3c.jstevens@bamboo.verinet.com>
On Fri, 13 Aug 1999 19:45:02 GMT, Michael P. Reilly <arcege@shore.net> wrote:
>John W. Stevens <jstevens@basho.fc.hp.com> wrote:
>: Kvan wrote:
>:>
>:> Ian Clarke <I.Clarke@strs.co.uk> writes:
>:>
>:> > Perl seems to be more of a rebellion against good language design, and
>:> > while people claim that this makes it "more efficient" to code in, I
>:> > have yet to see the proof - particularly if you include the time it
>:> > takes to debug the code.
>:>
>:> The proof with a thing such as coding, and particularly debugging, can
>:> only be seen by doing it. Perl offers lots of debugging options, and
>:> is in fact one of the easiest languages I've debugged in yet.
>
>: Perls built in debugger is a plus. I wish Python had a -d switch.
>
>Python's debugger is a module called "pdb". If you want to debug a
>program (called as a program), then you would type:
Right. Note, however, the statement I read. Python's debugger is
not built in.
>: On the other hand, in small studies, Python programmers create fewer
>: bugs in the first place, find the ones they do create faster, and
>: fix them with less chance of introducing new bugs.
>
>Oh... this isn't all that true. Experienced Python programmers create
>as many bugs as experienced Perl or C programmers.
Sorry, but in six separate, small studies, it turned out to be true.
May I ask, how did you decide that defect rates are identical
irregardless of language?
>It's the classes of
>bugs that may be different, that that's normal with different
>languages.
There actually are different defect rates for different languages.
The DOD discovered this, proved it all over again, then tried to
develop a language that provides a lower, steady state defect
rate.
They suceeded with the language, failed to get more than a handful
to use it.
Remember, in DOD applications, it isn't just a bug. It's
a fatality.
>Python programmers may appear to create fewer bugs when in reality they
>often create fewer design flaws;
I wasn't differentiating between the two, but at level of precision,
a different discussion is required.
>the Python programmer will still make
>the same amount of bugs.
If by "bug" you mean: "typo", I may agree, some what, though
even there, the use of more and longer words versus an ASCII
character reduces typos, as well.
>One of the advantages of Python written using
>it's basic syntax is that the syntax looks very much like most
>algorithms would be written. Perl's syntax sugar is there to reduce
>the coding times, but sometimes at the expense of clarity of the
>algorithm. This isn't always the case, a person could write unclear
>Python code and very clear Perl code.
My statements are re: groups, not individuals. It is perfectly
reasonable to state that: "it is possible for an assembly language
programmer to write clearer code than a somebody else writes Perl".
But across the average group, this is unlikely.
>But when taken in the context of
>the general structures and common idioms of each language, this is
>most often the case.
Yes. In effect, you said what I said: On the average. . .
>: This is a generically true statement: "Once you've learned how to do
>: it, you know how to do it."
>
>: Perl is harder to learn how to read, harder to remember how to read,
>: and harder to read if you, yourself, did not write it.
>
>And putting on my release manager cap, Perl is harder to maintain and
>manage in general than Python code.
That is my assertion. Based on real world experience.
>This is not always the case, just
>a week or so ago, I was asked to integrate DBI::Oracle into wdb (using
>isqlperl; remember that? a Perl4 interpreter). Except for finessing
>the initialization to switch between the isqlperl and Perl5
>interpreters when appropriate, the code changes were fairly clear. The
>other Perl code I was asked to change (which was the majority of the
>code) wasn't as well organized and thought out, and more difficult to
>update.
Yes. Again, my assertion is re: the average, not a specific case.
I'm sure that there are some viable Perl systems, my assertion is
that they are less likely than vialbe Python systems.
>: For short, small, throw away programs, especially if you do
>: pure-procedural
>: programming, Perl is rather nice. And before PCRE, I prefered Perl to
>: Python for text processing.
>
>Can't beat Perl's regexp engine, but I rarely need to use regular
>expressions anymore. Most of the parsing I do (some of which aren't
>trivial), can be done through Python's string module.
Yes.
>: With PCRE, I prefer Python. I am slowly giving up Perl altogether,
>: except as a training language in OO classes. Not to surprisingly,
>: Python is preferred more than 7 to 1 over Perl by students who are
>: exposed to both at the same time.
>
>As some of the pro-Perl people here have admitted, learning Perl _can_
>be a task, and Python has a clearer syntax. But this is not an
>argument for which is a better language.
Better language, without context, is pretty meaningless. My assertions
re: Perl vs. Python are set in the context already specified:
average programmers, teams, large projects that have an average
turn over rate in the teams.
>(Not to mention that this "7
>to 1" reminds me of that old 9 out of 10 grade school kids prefer Crest
>commercial, or whatever it was.)
Those figures come out of a number of classes, where the students
knew neither Perl nor Python when they walked in. Note that some of
these classes were held to teach OO, some were held simply to teach
"scripting languages".
>We aren't trying to promote the
>languages, but give clear arguments of when and why one language would
>be better over the other.
Feel free. I personally use Perl. But I won't recommend it to
my clients or students for use in a corporate environment.
Admittedly, it is getting easier to find somebody who knows Perl.
But it isn't easy to get somebody who knows Perl and can maintain
any kind of Perl.
John S.
------------------------------
Date: Sat, 14 Aug 1999 03:36:48 GMT
From: jstevens@bamboo.verinet.com (John Stevens)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9p2g.h3c.jstevens@bamboo.verinet.com>
On 13 Aug 1999 14:04:07 -0700, Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting mailed to cited author]
>
>In comp.lang.perl.misc,
> "John W. Stevens" <jstevens@basho.fc.hp.com> writes:
>:Perl is harder to learn how to read, harder to remember how to read,
>:and harder to read if you, yourself, did not write it.
>
>Proof my assertion, eh? I disbelieve.
Feel free.
>I want to see quantifiable,
>reproducible, and consequently irrefutable proof that Perl code that I
>did not write is harder for me to read than Python code I did not write.
You, Tom, are not the average.
The sheer number, the number of levels (beginner, intermediate, novice),
the time necesary to climb the Perl learning curve, the speed at which
particular bits of Perl syntax get forgotten. . . are all quantifiable.
I used Perl constantly, and almost exclusively, for two years.
Now, I have trouble remembering, and reading Perl. The same complaint
has been voiced to me by my students.
John S.
------------------------------
Date: 14 Aug 1999 03:36:23 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9p2h.pu8.sholden@pgrad.cs.usyd.edu.au>
On Sat, 14 Aug 1999 03:08:33 GMT,
John Stevens <jstevens@bamboo.verinet.com> wrote:
>On 14 Aug 1999 02:32:12 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>>On 13 Aug 1999 20:04:03 -0700,
John W. Stevens <jstevens@basho.fc.hp.com> wrote:
>>>
>>>Perl doesn't have lists. Python doesn't have built-in arrays.
>>
>>You should learn some perl you now..
>>
>>@array = (1,10,20,30);
>>$from_list = (1,10,20,30);
>>$from_array = @array;
>>print "$from_list\n$from_array\n";
>>
>>Will output :
>>30
>>4
>
>The @ prefix denotes an array. You, yourself, should learn
>Perl. Calling an array a list, doesn't make it one.
Can you read?
Can you see a @ in the following line of code :
$from_list = (1,10,20,30);
No you can't. Is there an array in that line of code? No. Is there a list
in that line of code? Yes. Do lists and arrays behave differently? Yes, just
look at the different outputs.
>
>>Perl has lists,
>
>Not built in, it doesn't, unless you define array and list as being
>different words for exactly the same type/class.
I don't think you can get more built in then perl lists.
Again I repeat, here is a perl list : ('a', 'b', 'c') or qw(a b c)
>
>>if you know perl you would know this.
>
>I know Perl. You need to learn Python.
Did I mention a single bit of python syntax in my post? No.
Was I discussing python syntax? No.
Do you know if I use python? No.
Do you know if I like python? No.
Do you know if I have already spent time learning python?
Do you know if I am currently learning python?
What was the point of saying I need to learn Python? I wasn't saying python
was worse than perl, I wasn't saying python syntax is strange, I wasn't
talking about python. You might as well have told me to learn C or Lisp.
At least Lisp would be more relevant than python, if you were trying to
tell me to learn about lists in some strange abstract way.
Have I questioned your python knowledge? No.
Have I questioned your perl knowledeg? Yes, but only because you have
consistantly made basic mistakes when speaking about perl.
>
>>If you program in perl
>>and don't know this, then you must get very very confused at times.
>
>If @ denotes list, then the following Perl would be illegal:
>
>@ary = (1, 2, 3);
>@ary[5] = "Test";
>
>But, obviously, this is not illegal.
@ary[5] is an array slice. It is an array. It happens to be an array
that constists of only one element. Why would it be illegal? It is just
the special case of :
@ary[1,2,3,4,5,10,20]
It is an array. Thus it has a @.
Used like that it is almost a sure indication of an error by the programmer,
because a single element array slice has no benefit over the simple
array element in that context.
>
>>>I will assume that a list module is available for Perl.
>>
>>No it is one of the built in bits... like hashes and arrays.
>
>Really? What is the prefix character that denotes a list?
You can't have a list in a variable. Lists in perl are constant. So
what would be the use of putting them in a _variable_. Just because there
is no list variable does not mean there are no lists. Again here is a list :
(1,2,3,4,5,6,7,8)
>
>>>I wasn't trying to compare features, I was simply pointing out
>>>that your comparison was Apples and Oranges, and therefore at
>>>least somewhat invalid.
>>
>>Only because you have no idea what you are talking about.
>
>:-)
>
>Coming from somebody who doesn't know the difference from *EMULATING*
>a list with an array, vs. a real array, that is a good one!
Again here is a list :
(1,2,3,4,5,6,7,8)
That is not an array. It is a list. It is different from an array. I already
showed how assigning to a scalar gives different results for lists and arrays,
here are some more differences :
push( (1,2,3,4,5), 6);
This results in an error message, funnily enough the message is :
Type of arg 1 to push must be an array (not list)
Still claim perl has no lists? Of course you know better then perl itself.
@array = (1,2,3,4,5);
push(@array,6);
That works fine, because we are passing an array to push not a list.
Pop is the same :
pop (1,2,3,4,5);
Is an error (the message is as above s/push/pop/)
@array = (1,2,3,4,5);
pop @array;
Is legal and pops the 5 off @array.
>
>Now I suppose that you will tell me that Perl has stacks, too!
>;->
No it doesn't.
--
Sam
why can't newbies use hash slices in their hello world programs? :-)
-- Uri Guttman in <x74skxhve5.fsf@home.sysarch.com>
------------------------------
Date: Sat, 14 Aug 1999 03:39:39 GMT
From: jstevens@bamboo.verinet.com (John Stevens)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9p7r.h3c.jstevens@bamboo.verinet.com>
On Fri, 13 Aug 1999 19:55:36 GMT, Michael P. Reilly <arcege@shore.net> wrote:
>John W. Stevens <jstevens@basho.fc.hp.com> wrote:
>: I R A Darth Aggie wrote:
>:>
>:> On Thu, 12 Aug 1999 09:31:05 +0100, Ian Clarke <I.Clarke@strs.co.uk>, in
>:> <37B28649.9C7F0C1E@NOSPAM.strs.co.uk> wrote:
>:>
>:> James - as a fortran programmer, I can make any language unreadable...
>
>
>: Ok. I'll take that challenge. . . create for me an unreadable
>: Python program that actually compiles and runs.
>
>John, pls don't throw out challenges you aren't willing to own up to. ;)
Oh, I own up to it, I do!
Try me. If I can't understand it, I'll say so.
John S.
------------------------------
Date: Sat, 14 Aug 1999 03:42:45 GMT
From: jstevens@bamboo.verinet.com (John Stevens)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9pdl.h3c.jstevens@bamboo.verinet.com>
On 13 Aug 1999 14:07:45 -0700, Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting mailed to cited author]
>
>In comp.lang.perl.misc,
> "John W. Stevens" <jstevens@basho.fc.hp.com> writes:
>:Ok. I'll take that challenge. . . create for me an unreadable
>:Python program that actually compiles and runs.
>
>Ok, I just showed the paperboy some python programs, and he didn't
>think were readable at all.
The challenge was to show ME, not the paper boy.
So far, nobody has posted any code, though I did see some
URL's I'm going to go look at.
>Please face it: terms like "readable" and "intuitive" are completely
>subjective, and therefore purely opinion.
No, they *AREN'T* purely subjective.
The human animal has wired in perceptual preferences.
More visually acute is *objectively* better.
Complexity is also measurable. Less unecesary interaction and
dependencies make a program *objectively* more intuitive and
readable.
John S.
------------------------------
Date: Sat, 14 Aug 1999 03:56:06 GMT
From: jstevens@bamboo.verinet.com (John Stevens)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7r9q6l.h3c.jstevens@bamboo.verinet.com>
On 13 Aug 1999 15:55:18 -0400, Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "JWS" == John W Stevens <jstevens@basho.fc.hp.com> writes:
>
> JWS> It comes down to the issue we discussed once before: Python is
> JWS> the better language for OO, and I write OO most of the time. I
> JWS> know you disagree. But my students, in general, also believe
> JWS> that Python is a better OO scripting language than Perl.
>
>check out the new book, OO Perl by damian conway. it is on the presses
>now and should be on sale at the monterey conference (which has a python
>track). it will answer all your OO perl issues and more.
Thank you. I will. Perl cannot be used without manuals.
>if done right
>and by using modules to help OO is veyr powerful and useful in perl.
My primary complaint re: OO-Perl, is the lack of "expected" keywords
and OO syntax.
Functionally, OO-Perl is just as powerful as Python. Just a heck of
a lot more difficult to write and read.
>i
>don't prefer OO unless it is warranted.
When is it warranted?
When is it *NOT* warranted?
I have my own guidelines, ones that I teach when I teach OO, but
I am curious as to where other people draw the line.
>that is one of the reason i
>don't like java/python types of languages. i want to be able to choose
>OO or not myself and not have the language force it upon me.
Python does not force OO on you. You can use it as a purely procedural
language.
>OO is not a
>cure all for programming ills.
Agreed. There is no such thing as a silver bullet.
>it is just another methodology in the long
>line that stretches back to structured programming and early high level
>languages that were supposed to save the world from bugs.
And, in point of fact, those earlier methodologies did indeed reduce
the number of bugs.
>OO won't do
>that either. it still falls on the shoulders of those who know how to
>design code vs those who can't.
Yes, but OO is an improvement over previous methodologies.
It lowers the bar, allowing less talented programmers to design,
write and maintain more complex systems.
One of the reasons that earlier methodologies did not *LOOK* like
they were successful is that the complexity and size of systems
increased faster than the methodologies could evolve.
Compare the complexity of Windows 2000 to, say, Windows 3.11.
>you can design lousy OO and most of it
>is like most code in general is. it isn't any more shareable and a well
>written library with a good api.
OO isn't so much new, as it is a combination and formalization of
some previous methodologies.
>as for newbies finding
>python more readable (as opposed to experienced c programmers) that is
>meaningless.
If that were the case (that only newbies find Python more readable),
you might be right (but only if you assume that the ability to read
and understand programs even if not a programmer is useless).
But there is more to it than that.
>i find tcl hard to read too. a well as lisp (which i know)
>and other languages which i don't know. tom's point about not knowing
>how to read a foreign language is very true. how does that line go?
>boy i am glad i was born in the US, because i know english already.
It is true, however, that some languages are easier to learn than
others, and that once learned, are easier to remember.
John S.
------------------------------
Date: Sat, 14 Aug 1999 03:58:25 +0000
From: Chad Netzer <chad@vision.arc.nasa.gov>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <37B4E960.10BFB4DD@vision.arc.nasa.gov>
Tom Christiansen wrote:
[slightly fixed example below]
> a = 10
> b = ["alpha", "beta", "gamma"]
> c = { "fred" : "wilma", "barney" : "betty" }
> print "a is", a
> print "b nought is", b[0]
> print "c fred is", c["fred"]
>
> Go ahead. Grab it all with your mouse and punch it all in. You can't
> do it.
Sure I can, although I first type the following line:
if 1:
Most of the differences betwen the languages seem trivial, and
ultimately, philosophical. Some people will naturally like the Perl
way of doing things, while other will prefer Python. They are both
great languages for solving many types of problems.
As far as I'm concerned, Perl rocks and Python rocks also. Tcl sucks,
though. :-)
Chad Netzer
chad@vision.arc.nasa.gov
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.
------------------------------
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 519
*************************************