[13126] in Perl-Users-Digest
Perl-Users Digest, Issue: 536 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 15 04:07:18 1999
Date: Sun, 15 Aug 1999 01:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 15 Aug 1999 Volume: 9 Number: 536
Today's topics:
DBD::msql on win32 <tortuga@leland.stanford.edu>
Re: HARASSMENT -- Monthly Autoemail (Miguel Cruz)
Re: HARASSMENT -- Monthly Autoemail (Bill Moseley)
Re: HARASSMENT -- Monthly Autoemail <jkline@one.net>
Re: How to format string? (Anno Siegel)
Re: How to format string? <chi@cybie.com>
Re: How to format string? (Larry Rosler)
Re: Nastiness contrary to the spirit of perl? <jeff@jeffroe.force9.co.uk>
newbie search script help <jeff@247sk8mag.com>
Re: Perl penetration into Fortune 500? (brian d foy)
Re: Perl/TK issues (Donovan Rebbechi)
Re: Port to PalmOS??? <jkline@one.net>
Re: Tom Christiansen "Perl Cookbook" (elephant)
Unable to catch Perl errors into file on NT?? <shmooth@yahoo.com>
Re: Wacky Programming Tales (Was Re: Why use Perl when (Paul Jackson)
Re: Why use Perl when we've got Python?! (Abigail)
Re: Why use Perl when we've got Python?! (Abigail)
Re: Why use Perl when we've got Python?! (Abigail)
Re: Why use Perl when we've got Python?! (Abigail)
Re: Why use Perl when we've got Python?! (Abigail)
Re: Why use Perl when we've got Python?! (Abigail)
Re: Why use Perl when we've got Python?! (Abigail)
Re: Why use Perl when we've got Python?! <shmooth@yahoo.com>
Re: writing an html file into another html file <shmooth@yahoo.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 15 Aug 1999 00:37:38 -0700
From: Josh Suarez <tortuga@leland.stanford.edu>
Subject: DBD::msql on win32
Message-Id: <37B66E41.194338D1@leland.stanford.edu>
Hi there,
Has anyone gotten the msql module to work on win32? If so, were you
using a particular port of msql?
Thanks,
Jim
------------------------------
Date: Sun, 15 Aug 1999 05:11:11 GMT
From: usenet@admin.u.nu (Miguel Cruz)
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <PZrt3.2091$Pw1.5056@news4.giganews.com>
William Pettrey <Bill@fuckyou.co.uk> wrote:
> I'm not participating in the perl group, I didn't pay attention to the
> cross posting when I clicked reply
Well, now that you've admitted responsibility we can put this sorry matter
behind us.
miguel
------------------------------
Date: Sat, 14 Aug 1999 22:26:19 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <MPG.121fef56fe1efc159896b9@nntp1.ba.best.com>
Jim Seymour (jseymour@jimsun.LinxNet.com) seems to say...
> People who quote the entire text of the article they're
> following up, and *particularly* those who place their comments
> before all that quoting, are being massively inconsiderate and
> lazy, IMO. Not to mention wasting bandwidth and disk space.
Even at my slow 56k modem speed it doesn't bug me THAT much to see an
entire article quoted. And I'm not worried about filling up my 30GB
drive anytime soon. Sure, I like reading a well formatted response
better than one that's not. But it's just not that big of a deal if it
isn't perfect. And I doubt the extra quoting will break usenet, either.
This isn't comp.lang.perl.big-binaries.mp3, after all.
I don't feel like it's a huge waste of my time reading articles that
aren't quoted properly. But, I do find it a waste of my time trying
weed out the interesting perl related articles from all the threads like
this one.
I feel sorry for people that come here for real perl help only to have
their questions lost in the noise.
Bring me another beer, bartender.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Sun, 15 Aug 1999 02:33:21 -0400
From: Joe Kline <jkline@one.net>
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <37B65F31.F2835D22@one.net>
Jim Seymour wrote:
> In article <37b4d4b0.25250093@news.interpath.net>,
> gh@netquick.net (Gil Harvey) writes:
> [snip]
> >
> > I don't think any of us dispute TCs knowledge of perl - I also
> > make much use of his writings - but that is no excuse for his assine
> > email tactics.
> [snip]
> <SNIP>
>
> I apologize for the rather harsh tone my follow-up has taken.
> But sometimes I get a mite peeved at the modern notion that
> people ought to be allowed to behave in any anti-social manner
> they like and that somehow anybody who attempts to correct their
> behaviour is at fault.
Welcome to the world given to us by post-modern philosphers and their politically
correct, jack-booted thugs.
joe
------------------------------
Date: 15 Aug 1999 05:17:09 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to format string?
Message-Id: <7p5igl$vdh$1@lublin.zrz.tu-berlin.de>
Chi Yu <chi@cybie.com> wrote in comp.lang.perl.misc:
>Greetings,
>
>Can someone please help me format a string? I want to format a url into
>a 12 character string, minus the periods and forcing each node to use 3
>digits.
>
>e.g. "212.67.198.54" would become "212067198054"
That's not exactly what is meant by url, but never mind.
>Is there a regular expression that will quickly accomplish this feat?
Maybe, but sprintf does the trick quite neatly in this case:
my $formatted = sprintf "%03d%03d%03d%03d\n", split m/\./, $addr;
Anno
------------------------------
Date: Sat, 14 Aug 1999 22:32:08 -0700
From: Chi Yu <chi@cybie.com>
Subject: Re: How to format string?
Message-Id: <37B650D8.FBAD208A@cybie.com>
Anno,
Thank you very much for your prompt, accurate, simple answer!
You're absolutely right about the misspoken/mistyped 'url'. I meant to
say IP address.
Warm regards,
Chi
Anno Siegel wrote:
>
> Chi Yu <chi@cybie.com> wrote in comp.lang.perl.misc:
> >Greetings,
> >
> >Can someone please help me format a string? I want to format a url into
> >a 12 character string, minus the periods and forcing each node to use 3
> >digits.
> >
> >e.g. "212.67.198.54" would become "212067198054"
>
> That's not exactly what is meant by url, but never mind.
>
> >Is there a regular expression that will quickly accomplish this feat?
>
> Maybe, but sprintf does the trick quite neatly in this case:
>
> my $formatted = sprintf "%03d%03d%03d%03d\n", split m/\./, $addr;
>
> Anno
------------------------------
Date: Sun, 15 Aug 1999 00:07:37 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to format string?
Message-Id: <MPG.122006f26f0d7f67989e5d@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <37B647F4.F72C4DE9@cybie.com> on Sat, 14 Aug 1999 21:54:12 -
0700, Chi Yu <chi@cybie.com> says...
> Can someone please help me format a string? I want to format a url into
> a 12 character string, minus the periods and forcing each node to use 3
> digits.
>
> e.g. "212.67.198.54" would become "212067198054"
That is a dotted-quad IP address, not a URL.
> Is there a regular expression that will quickly accomplish this feat?
$ip_address =~ s/(\d+\.?)/sprintf '%.3d', $1/eg
But this makes fewer function calls:
$ip_address = sprintf '%.3d%.3d%.3d%.3d', $ip_address =~ /(\d+)/g
I prefer split() to the regex:
$ip_address = sprintf '%.3d%.3d%.3d%.3d', split /\./, $ip_address
So there are Three Ways To Do It, and I'm sure there are plenty more.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 15 Aug 1999 06:21:40 +0100
From: "Jeffrey Roe" <jeff@jeffroe.force9.co.uk>
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <o7st3.4416$wC.107947@stones>
Id Est <id-est@home.com> wrote in message
news:slrn7rcbt5.9v9.id-est@erato.bigredrockeater.com...
<SNIP>
> once i get as good as Abigail claims to be, i'll probably do just that.
> but since i don't get the benefit of her experience, just her invective,
> that may be some time.
>
> btw, don't bother spewing on me Abigail. i plonked you 6 months ago and
> so i won't see your no-doubt lucid commentary. no great loss, i'm sure.
I cannot believe that you plonked someone who appears to me to be one of the
best perlers (?) that posts to this group. Having lurked in this group for
last three weeks to try to learn about Perl and what it's used for and any
Gotcha's for newbie's I can see that although Abigail may be a bit short
with people who post silly questions she knows her Perl.
(getting fed up with people complaining about being asked to follow usenet
standards - doesn't seem to be that great a hardship to me).
Jeffrey Roe
------------------------------
Date: Sun, 15 Aug 1999 00:37:57 -0500
From: "twentyfour seven" <jeff@247sk8mag.com>
Subject: newbie search script help
Message-Id: <37b6451e.0@news.advancenet.net>
Hi,
I'm having problems not with the query itself, its the links that it
generates at the bottom remove the + from between the words and causes a
syntax error. Is there a snippet of code I can use to make sure that this +
is not excluded from the link?(the links call the script to get the next 10
search results). I would appreciate a response.
Thank you
--
[--Twentyfour seven online skateboarding magazine--]
URL: http://www.247sk8mag.com
email: jeff@247sk8mag.com
------------------------------
Date: Sun, 15 Aug 1999 02:49:28 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Perl penetration into Fortune 500?
Message-Id: <brian-1508990249280001@99.new-york-66-67rs.ny.dial-access.att.net>
In article <19990814152510.09614.00001065@ng-bg1.aol.com>, bbirthisel@aol.com (Bbirthisel) wrote:
>It might be more interesting to discover of any of those companies
>do not use Perl anywhere
i have already discovered company policies mandating ASP for web
stuff. however, methinks Perl is too useful be not being used
somehow. certainly Microsoft's interest should be compelling even
to PoBs.
however, i know a lot of admins that don't necessarily follow company
policy to get the job done. :)
--
brian d foy
------------------------------
Date: 15 Aug 1999 02:06:11 -0400
From: elflord@panix.com (Donovan Rebbechi)
Subject: Re: Perl/TK issues
Message-Id: <slrn7rcm6i.4e6.elflord@panix3.panix.com>
On 14 Aug 1999 20:22:49 GMT, lt lindley wrote:
Thanks for the advice. I'll take a good look at it.
I've made the program available ( under the same terms as perl itself )
at
http://pegasus.rutgers.edu/~elflord/unix/ftp.pl
and there's a (2html.vim) colourful version that you can view in
your browser at
http://pegasus.rutgers.edu/~elflord/unix/ftp.pl.html
It doesn't do very much unless you have a hacked version of Net::FTP
( which I'll probaly have to ship as part of the package )
Anyway, it's up there because it's too long to post to a newsgroup.
If you can make any good general comments ( I hardly expect anyone
to read every line ;-), I'd be very appreciated, as I'm still learning.
Cheers,
--
Donovan
------------------------------
Date: Sun, 15 Aug 1999 02:39:16 -0400
From: Joe Kline <jkline@one.net>
Subject: Re: Port to PalmOS???
Message-Id: <37B66094.F02334A3@one.net>
<< Courtesy email sent to Hansan Diwan >>
Hansan Diwan wrote:
>
> Is there a port to PalmOS? If so, where might i find it?
> --
Not just yet, but to keep track of current ports, check out:
http://www.perl.com/CPAN/ports/index.html
joe
------------------------------
Date: Sun, 15 Aug 1999 17:32:02 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Tom Christiansen "Perl Cookbook"
Message-Id: <MPG.122117fd7a71c020989c23@news-server>
support@gethits.com writes ..
>Malcolm Ray wrote:
>>
>> On Fri, 13 Aug 1999 09:56:00 -0400
>
>> Sometimes even the best books are wrong! When there's a discrepancy,
>> always trust the module's own documentation.
>
>Thanks for confirming this. After multiple tests using both
>codes, I had to come to the conclusion that the book must
>be wrong since the module's author's method worked and "Cookbook's"
>didn't (everything else remaining constant of course). Even
>the great ones can err!
both methods still work on my machines
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Sun, 15 Aug 1999 07:33:18 GMT
From: Shmooth <shmooth@yahoo.com>
Subject: Unable to catch Perl errors into file on NT??
Message-Id: <37B66C08.F1E9C651@yahoo.com>
I'd like to try using the 'splain.bat' that came with the ActiveState NT
Perl distribution, only I can't seem to catch the output of my faulty
perl prog. How to do?
I've tried:
> faulty.pl >out.txt 2>&1
I end-up with an 'out.txt' with nothing in it.
------------------------------
Date: 15 Aug 1999 06:13:06 GMT
From: pj@sgi.com (Paul Jackson)
Subject: Re: Wacky Programming Tales (Was Re: Why use Perl when we've got Python?!)
Message-Id: <7p5lpi$g1l0@fido.engr.sgi.com>
Steve Bourne, who wrote the Bourne shell (and the
debugger, adb) was notorious for encoding the
entire source in some Algol-like control structures,
using #define's. It inspired many a coding-standard
proclamation, for years after inside Bell Labs, that
one shall not use #define's to redefine syntax.
[I always figured that he had to write adb, because
he needed it to debug the tortured code in his shell.]
--
=======================================================================
I won't rest till it's the best ... Software Production Engineer
Paul Jackson (pj@sgi.com; pj@usa.net) 3x1373 http://sam.engr.sgi.com/pj
------------------------------
Date: 15 Aug 1999 00:19:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7rcjg9.a5.abigail@alexandra.delanet.com>
John Stevens (jstevens@bamboo.verinet.com) wrote on MMCLXXIV September
MCMXCIII in <URL:news:slrn7rb8ik.gr0.jstevens@bamboo.verinet.com>:
!! On 13 Aug 1999 14:26:17 -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:
!! >:Due to this feature alone, Python programs are easier to read by
!! >:non-authors than Perl programs are.
!! >
!! >Prove that. Stop asserting it. Prove it.
!!
!! No matter what I post, you will not accept it as proof. If you
!! really are interested in proof, perform your own investigation.
!!
!! Of course, if I am wrong, simply tell me what you will accept as
!! proof.
Gives use verifyable data. Just chanting "Python programs are easier to
read by non-authors than Perl programs are" doesn't make it so.
However, I am willing to believe that. But here's my answer: "So what?".
!! >Here's your challenge. Pick a Perl programmer with experience equivalent
!! >to mine,
!!
!! Now, just how many Perl programmers have your level of experience?
!!
!! How much does it cost to become as good as you?
People think I'm pretty good, and I didn't pay a dime for learning Perl.
In fact, I didn't even buy a book.
!! Can these people do other things, and still stay good at Perl?
I do lots of other things, and I'm still good at Perl. In fact, doing
other things makes me better at Perl.
!! >I say this for certain because I *do* read their code, and it's completely
!! >easy to do so.
!!
!! Yes? There is a sig:
!!
!! #!/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
!!
!! So, tell me, in thirty seconds or less, and without refering to a
!! reference manual, what this does? If you
!! wrote this, or have ever seen it before, this test is invalid.
Djees. That's easy.
$^ is an encrypted string. A copy is made in $_. y/// does most of the
decryption, leaving a string with the first line of the above program
and some two character strings consisting of a $ followed by a char. A
final nifty s///e puts the encoded string back in and creates appropriate
newlines. Clever use of $0 protects the original $'s. You end up with a
string that's identical to the program; and that string is printed.
Granted, it took me a couple of minutes, but I didn't look at the manual.
!! You, of course, may well complain that this test is invalid or
!! unfair because *YOU* would never write code like this. But if
!! you have problems with this, then why allow it? If you have
!! problems with this, everybody else will, too.
Well, the test is invalid because the code was written to be obscure
on *purpose*. What is next, creating a new natural language because you
can say naughty things, or poorly phrased sentences in English?
The fact that you can say "A green Wednesday likes from screaming pianos",
which is correct according to English grammer, didn't prevent Shakespeare
to write his works. And I don't believe that by creating a new language
that prevents nonsense like the above, everyone becomes instant Shakespeares.
!! >If you're talking about someone who can't stop treating Perl like
!! >BASIC or FORTRAN, and just doesn't `get' it, then sure, it's unnatural.
!! >But that's hardly my fault that they don't know Perl, now is it?
!!
!! It is indeed partially the fault of the author, if a programming
!! language does not enforce at least a minimal set of good programming
!! practices.
Is it the fault of the producer of bikes, that not every bikes comes with
a set of trainingwheel?
Abigail
--
$" = "/"; split $, => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Aug 1999 00:26:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7rcjt9.a5.abigail@alexandra.delanet.com>
Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXXIII September
MCMXCIII in <URL:news:37b47fd7@cs.colorado.edu>:
##
##
## What's a "scripting" language, for goodness sake?
It's another term for "wannabee" language.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Aug 1999 00:54:45 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7rclj4.a5.abigail@alexandra.delanet.com>
John W. Stevens (jstevens@basho.fc.hp.com) wrote on MMCLXXIII September
MCMXCIII in <URL:news:37B46B46.80D5B51E@basho.fc.hp.com>:
$$
$$ No. Python enforces indentation to aid the programmer.
Rubbish. Without indentation, Python doesn't know where the block ends.
Python enforces indentation, for the same reason as Perl enforces { and }.
To tell the compiler where blocks begin and end.
I'll grant you that in certain cases, the opening brace is redundant.
But doesn't that hold for Pythons ':' as well?
I don't think this is a big issue though. It is funny that Python
advocates often argue that Perl is so dense, and hard to read, while they
think that not having to use '{' and '}' saves them a lot of typing. It's
only one frigging character per block! (As most (all?) blocks in Python
are proceeded by a ':' anyway.
People tend to use indentation anyway, so enforcing it isn't a big deal.
Not enforcing it isn't a big loss either; for the same reason. And not
enforcing it allows you to every so often to not have straight left lines
in your code, but to add or remove extra space for even better readability:
foreach my $foo (@foos) {
....
....
LABEL:
while ($horror) {
....
....
}
}
Outdenting labels makes your code more readable, in my opinion (and that of
perlstyle.pod). Other examples:
my $foo = 17;
$foo ++ if condition; # Line up the parts belonging together.
$bar = "Ghost riders in the sky";
$quz = "Happy, happy, joy, joy";
($zuc, $zac) = @fluppies; # Line up the $'s and the ='s.
Of course, Perl code doesn't change meaning if something (like IRC)
strips leading whitespace (or collapses whitespace, like in HTML), Python
code does. This is, in my opinion, the strongest argument against use
of mandatory whitespace. And how do you count the number of spaces if
you read code typeset in proportional font? Does that really aid the
non-author? I think it's the opposite.
I can find an argument for using mandatory whitespace though. It avoids
wars about bracing style....
Abigail
--
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Aug 1999 01:01:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7rcm06.a5.abigail@alexandra.delanet.com>
John Stevens (jstevens@bamboo.verinet.com) wrote on MMCLXXIV September
MCMXCIII in <URL:news:slrn7rb75k.gr0.jstevens@bamboo.verinet.com>:
\\
\\ >Perl is also 100x more popular than Python -- simple because
\\ >even stupid people *are able* to use it!
\\
\\ I don't necesarily agree or disagree that Perl is 100 times more
\\ popular than Python. I don't have figures I can trust.
But you seem to have lots of other mythical figures that you do trust.
\\ Perl is probably popular because:
\\
\\ 1) People think CGI means Perl, even though CGI can be done
\\ in any language.
\\ 2) Perl was released before Python.
\\ 3) Perl is less of a change, if you are coming from C/Shell/Unix,
\\ than Python is.
\\
\\ What makes you think that the people who use Python are that different
\\ from the people that use Perl? Maybe "stupid", simply means, "prefers
\\ not to use a dollar sign to indicate a scalar type"?
Ah, but the dollar sign is there to make Perl look more like C than
Python looks like.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Aug 1999 01:57:41 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7rcp7g.a5.abigail@alexandra.delanet.com>
John Stevens (jstevens@bamboo.verinet.com) wrote on MMCLXXIV September
MCMXCIII in <URL:news:slrn7rb9b3.gr0.jstevens@bamboo.verinet.com>:
;; On Fri, 13 Aug 1999 15:46:44 -0400, Ala Qumsieh <aqumsieh@matrox.com> wrote:
;; >Ian Clarke <I.Clarke@NOSPAM.strs.co.uk> writes:
;; >
;; >Different people have
;; >different tastes, even when it comes to your programming language of
;; >choice.
;;
;; If the only difference between Perl and Python is style, not
;; functionality, then you've answered his question: there is no
;; need for him to learn Perl.
There's no difference in functionality between Perl, Python, C, Ada,
Eiffel, Pascal, Modula, LISP, Basic, Scheme, Forth, Algol, Fortran,
Cobol, DSSSL, ML, assembler, Java, C++, APL, PL/1, or Simula.
They're all Turing equivalent.
;; >Maybe 1, maybe none, maybe many. How would knowing this number help
;; >you?
;;
;; Quite a bit. If a large number have learned Python first, then
;; migrated to Perl, maybe that is because Perl has a generally
;; useful function that Python does not.
That looks a bit like "if a large number of people were first followers
of Moon, then migrated to druidism, maybe that's because druidism has
more magic than Moon has".
If people migrate away from Python in large numbers, than it must be
that Python is missing something important. But we aren't discussing
the flaws in Python here. On the other hand, people aren't migrating
away from Perl in huge numbers either, so the conclusion ought to be
that there's nothing wrong with Perl.
;; >If your goal was to learn Perl, then you took a wrong direction.
;;
;; The first step, is to find out what something costs. Before
;; learning Perl, it makes sense to find out whether the cost of
;; learning it will be worth the result.
Money isn't that important. And, for the same reason, perhaps you
should find out whether finding out if learning Perl is worth the
cost of learning is worth the cost of finding out.
;; >I don't think Perl has anything significant to offer over Python when
;; >it comes to functionality. The inverse is also true. Except maybe for
;; >regular expressions.
;;
;; Python and Perl's RE's are now identical.
Almost. Pythons RE's are equivalent to Perl RE's of perl5.004. Which
is 2 years old. But granted, the new features of perl5.005 regexes
aren't that important.
;; >But, IMO, Perl gives you the freedom to code the way you like. Python,
;; >OTOH, restricts you. A lot of people like Python because it restricts
;; >you and gives you only one way to do things. I think, the reason is
;; >that they are afraid of making choices.
;;
;; No. It is because spending the time to figure out that somebody
;; said the same thing, only in a different way, is a waste of time
;; and money.
Abolish English! Synonimes are bad!
;; >Perl on the other hand gives you more flexibility.
;;
;; Which gets you. . . what? Flexibility implies functionality that
;; Perl has that Python doesn't. So, what is this functionality
;; that Perl posesses, that Python doesn't, that you describe as
;; flexibility?
So... why doesn't Python look like a Turing machine? Or assembler?
And besides, this only applies to low-level things, like language
constructs and features. I can sort things using a gazillion different
algorithms, NO MATTER HOW RESTRICTED THE LANGUAGE IS.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Aug 1999 02:06:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7rcpp2.a5.abigail@alexandra.delanet.com>
Michael P. Reilly (arcege@shore.net) wrote on MMCLXXIII September
MCMXCIII in <URL:news:JV0t3.40$mV.9167@news.shore.net>:
[]
[] And consider:
[] sub who {
[] return ("fred", "george", "wilma", "jane", "pebbles", "judy");
[] }
[]
[] Does this return a hash or an array?
Neither. It's the wrong question to ask. Subs return either lists,
scalars, or nothing at all. But that's determined by the caller, not
the callee.
Which means that if you do:
$foo = who ();
you know that who() will return a scalar, without looking at who.
Abigail
--
sub A::TIESCALAR{bless\my$x=>A};package B;@q=qw/Hacker Another
Perl Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => 'A';print "$shoe $shoe $shoe $shoe\n";
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Aug 1999 02:19:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <slrn7rcqh3.a5.abigail@alexandra.delanet.com>
Russ Allbery (rra@stanford.edu) wrote on MMCLXXIV September MCMXCIII in
<URL:news:ylhfm3j7km.fsf@windlord.stanford.edu>:
$$
$$ 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.
Which is why I switched almost a decade ago changed the configuration
of my editor such that it is hard to enter a literal tab. Hitting tab
just inserts the appropriate amount of spaces.
Yeah, that does mean creating Makefiles is a bit awkward. Considering
the amount of coding Makefiles vs typing in other things, that's a price
I gladly pay. Besides, a simple ':set tabinsert' turns the behaviour off.
Abigail
--
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 15 Aug 1999 07:30:30 GMT
From: Shmooth <shmooth@yahoo.com>
Subject: Re: Why use Perl when we've got Python?!
Message-Id: <37B66B5F.9B165C16@yahoo.com>
Perl is installed on ISP's servers...Python is not.
:)
> over-complicated syntax. I have been searching this newsgroup for a
> convincing argument as to why someone would use Perl over Python. I did
------------------------------
Date: Sun, 15 Aug 1999 05:39:50 GMT
From: Shmooth <shmooth@yahoo.com>
Subject: Re: writing an html file into another html file
Message-Id: <37B6516F.B1BB498B@yahoo.com>
I just picked-up the text::basictemplate and text::template modules from CPAN
(http://www.perl.com/CPAN/modules/by-module/Text/). You'll see a README and the
distribution (usually a filename.tar.z) for each module. Download the module
and unpack it using the FAQ's linked-to off of www.perl.com. This is for a
perl-cgi-template soln.
The way (I think) it works is you write a simple cgi/perl script that gets
called when user clicks something and the script decides which 'template' file
to parse (depending on a filename (or set of) you've given), then decides what
to fill-in variables you've declared in the template. So it's kinda like server
side includes except a script has to be called to fill-in the article.
Or, if you can use the 'exec' (or maybe 'cgi'??) arguments for your server side
include tags, then you could say something like:
<!--#exec file=insert.pl <optional_args> -->') =>excuse the syntax here
The insert.pl script will be called before the file is sent to the browser and
you'll have to write insert.pl such that is prints to STDOUT whatever article
text/html you wish to appear.
JT Nicholas Tolson wrote:
> I've tried to do this with javascript and server-side includes, but because
> of the order in which things are processed, this didn't work. Here's my
> situation.
>
> What I have is many HTML templates for news articles, and then many html
> article files. What I want to do is put in a certain article file into a
> certain template on the fly. This way, I just create one template file for
> each section, and one article file, then place this article file into
> whatever template I need to.
> Then, if I want to put the same article in a different template, I don't
> have to create another page, I just slap the same article file into a
> different template file.
>
> To give you an idea of what I was trying to do, here's the javascript I was
> using (disregard any possible syntax errors in this):
>
> function writeSSI() {
>
> searchstr = location.search.substring(1)
> include = ('<!--#include virtual=\"/' + searchstr + '.html\"-->')
> document.write(include)
>
> }
>
> Then I call this function wherever I want the article to appear, but for the
> reason I mentioned earlier, this doesn't work.
>
> Any suggestions? BTW, excuse any ignorance of cgi/perl here, since I am
> below novice level.
>
> Thanks in advance.
>
> jtnt
> nicholas@edesigninc.com
------------------------------
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 536
*************************************