[10102] in Perl-Users-Digest
Perl-Users Digest, Issue: 3695 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 11 16:07:31 1998
Date: Fri, 11 Sep 98 13:00:17 -0700
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, 11 Sep 1998 Volume: 8 Number: 3695
Today's topics:
CGI.pm's HTML shortcuts (Jay Bartelt)
Re: Copying subroutines (Mark-Jason Dominus)
Re: How do you shadow/replace a subroutine? (Mark-Jason Dominus)
Re: Inheritance (Joey Hess)
Re: Inheritance <tchrist@mox.perl.com>
Installing 5.00502 - CPAN.pm doesn't work (Laszlo Ernesto de Miranda Pinto)
Re: mkdir() on NT?? (Ethan H. Poole)
Re: multiple patern matches <jdf@pobox.com>
Re: Pattern substitution (Craig Berry)
Re: Pattern substitution (Faust Gertz)
Re: Perl "mkdir" function (Faust Gertz)
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl & Java - differences and uses <borg@imaginary.com>
Re: Perl gurus opinion needed. (Mark-Jason Dominus)
Re: SPSS and PERL <nguyend7@msu.edu>
Re: Stripping out 'bad' HTML (Abigail)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Sep 1998 19:47:28 GMT
From: bartelt@enteract.com (Jay Bartelt)
Subject: CGI.pm's HTML shortcuts
Message-Id: <35f97d47.20964770@news.enteract.com>
I almost hate to ask this question, but...
Somebody in my group asked me for a list of HTML shortcuts created by
Lincoln in his CGI.pm module. I assumed a list would be in the CGI
doc but I don't see it. Is there a list somewhere? Searching CPAN
for a piece of documentation is sometimes like separating a specific
grain of sand from the beach
Thanks,
Jay
------------------------------
Date: 11 Sep 1998 15:48:44 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Copying subroutines
Message-Id: <6tbuqs$5un$1@monet.op.net>
In article <Ez4pwz.4vq@undergrad.math.uwaterloo.ca>,
Jasmin F. Patry <jfpatry@undergrad.math.uwaterloo.ca> wrote:
>Is the following expected behaviour?
Yes.
>This is actually the behaviour that I was hoping to achieve (storing a "copy"
>of a subroutine that persists even if the subroutine is redefined),
Oh, good.
>Can I rely on this?
Yes.
>Better yet, *why* does it work?
Teleological questions about computer programs always confuse me.
Here I might say ``It works because there reference refers to the
function, and not to its name.'' But that's what's called a `virtus
dormitiva' answer: It's like saying that opium puts people to sleep
because it possesses a virtus dormitiva. That explanation sounds
really clever, until you find out that `virtus dormitiva' is just
Latin for `sleep-producing power'.
Ultimately, the answer is either going to have the form ``Because
that's what seemed most useful'' or else ``See lines 384--407 in
pp.c.'' The former is a matter of opion; if you found the behavior
useful, you'll be persuaded, and if you didn't, you won't. And the
second kind seems to miss the point of your question somehow.
Maybe you could try asking differently?
------------------------------
Date: 11 Sep 1998 15:19:52 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: How do you shadow/replace a subroutine?
Message-Id: <6tbt4o$5o6$1@monet.op.net>
In article <35f95ebb.593402808@ganymede.rev.net>,
Bernard Cosell <bernie@fantasyfarm.com> wrote:
>The kind of thing I'd like to do is have a 'require' file that
>includes definitions that "intercept" calls to a few routines in an
>already-existing program. I've been trying to do something like:
> *origfcn = \&fcn ;
> *fcn = \&newfcn;
>That doesn't work [it gets me the proper result, but gets me a warning
>about redefining &fcn].
There are two things happening here: Perl is redefining the
subroutine, and it is also emitting a warning message. You want it to
redefine the function, but you don't want the warning message.
Sometimes warning messages are delivered inappropriately, but this is
not one of those times. It is strange that you should conclude from
this that the function was not redefined, and ask `how do you replace
a subroutine' when that is the part you are not having trouble with.
Your real question is `how can I suppress the warning message?' Then
the answer is:
{ local $^W = 0; # Suppress `Subroutine redefined' warning.
*origfcn = \&fcn;
*fcn = \^newfcn;
}
------------------------------
Date: Fri, 11 Sep 1998 11:41:02 -0700
From: joey@kite.kitenet.net (Joey Hess)
Subject: Re: Inheritance
Message-Id: <slrn6viqoj.80t.joey@kite.kitenet.net>
In article <6t8bns$gpd$2@csnews.cs.colorado.edu>, Tom Christiansen wrote:
| You can fetch all the code from
|
| ftp://ftp.oreilly.com/published/oreilly/perl/cookbook/pcookexamples.tar.gz
What's the copyright on that code? I own a copy of the cookbook and I didn't
see any notes in it about the code having different copyright than the book
as a whole. Which could be a problem if you actually use any of the code..
--
see shy jo
------------------------------
Date: 11 Sep 1998 19:13:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Inheritance
Message-Id: <6tbsoj$ma4$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, joey@kite.kitenet.net (Joey Hess) writes:
:What's the copyright on that code? I own a copy of the cookbook and I didn't
:see any notes in it about the code having different copyright than the book
:as a whole. Which could be a problem if you actually use any of the code..
If your restaurant decides that it would like to serve a dish out of
the Joy of Cooking, do you have to contact your lawyers first?
What do you think a cookbook is *for*, after all?
As far as I'm concerned, if I see it in people's programs, I'll be happy.
But if I see it in people's books, I'll be quite unhappy.
That's just my perspective, and not official.
--tom
--
PL/1, "the fatal disease", belongs more to the problem set than to the
solution set.
--E. W. Dijkstra
------------------------------
Date: 9 Sep 1998 19:37:34 GMT
From: laszlo@dcc.ufmg.br (Laszlo Ernesto de Miranda Pinto)
Subject: Installing 5.00502 - CPAN.pm doesn't work
Message-Id: <6t6ldu$fp2$1@usenet.pop-mg.rnp.br>
Hi,
I'm trying to install perl 5.005_02 in a Solaris 2.5.1 machine.
The compile (with gcc 2.8.1) worked without problems, 'make test'
reported no errors, so I went on to install CPAN 1.40. When I
started a 'make test', the program just hanged after printing
't/loadme............'. Does anyone know what is the problem ?
Laszlo de Miranda Pinto
--
laszlo@dcc.ufmg.br
Your fault: core dumped
------------------------------
Date: 11 Sep 1998 19:00:24 GMT
From: ehp@gte.net (Ethan H. Poole)
Subject: Re: mkdir() on NT??
Message-Id: <6tbs08$gui$1@news-2.news.gte.net>
[Posted and Emailed] In article <35F94559.3BF8ADC2@mindspring.com>,
psmith01@mindspring.com says...
>
>What does the 'MODE' argument look like on NT? Same as UNIX?
The MODE argument 'looks' the same on NT as unix, but because NT does not
manage permissions in a manner directly equivalent ot UNIX, about the only
real effect is either setting a directory for "read-only" or "read & write"
access.
--
Ethan H. Poole | Website Design and Hosting,
| CGI Programming (Perl & C)..
========Personal========= | ============================
* ehp @ gte . net * | --Interact2Day--
http://home1.gte.net/ehp/ | http://www.interact2day.com/
------------------------------
Date: 11 Sep 1998 21:17:18 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: syarbrou@ais.net (Steve .)
Subject: Re: multiple patern matches
Message-Id: <m3r9xio3wh.fsf@joshua.panix.com>
syarbrou@ais.net (Steve .) writes:
> I have a variable called $ip which holds the obvious an ip address. I
> want to see if it matches any one of a group of addresses.
This is addressed in perlfaq6, "How do I efficiently match many
regular expressions at once?".
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 11 Sep 1998 19:09:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Pattern substitution
Message-Id: <6tbsh2$j98$1@marina.cinenet.net>
Meenu (meenu@ms.washington.edu) wrote:
: I have following URL
: www.aol.com.
: and what I need to do is delete the (period at end) meaning make it
: www.aol.com
:
: 1. I tried using Chop & chomp.. how ever it doesn't work. Can anyone tell
: me why it doesn't work?
Chomp won't work unless $/ = '.'. Chop should work, unless there's some
additional character (a \n, perhaps?) after the final period.
: 2. then I tried using the substituion routine
: $new_url = ~ s/$./ /;
:
: It also doesn't work. Can anyone please help me on this.
That's wrong three, possibly four ways:
0. The binding operator is =~, not '= ~' as you have it.
1. You want to match a period before end-of-line, not after, right?
So the pattern is backward.
2. '.' in a regex is special; you need to escape it to get a literal
period.
3. You say you want to remove the period, not replace it with space,
so your substitution side may be wrong.
Applying all four: $new_url =~ s/\.$//;
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Fri, 11 Sep 1998 19:29:06 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Pattern substitution
Message-Id: <35fa7664.2561328@news.wwa.com>
On Fri, 11 Sep 1998 11:06:17 -0700, Meenu <meenu@ms.washington.edu>
wrote:
>I have following URL
> www.aol.com.
>and what I need to do is delete the (period at end) meaning make it
> www.aol.com
>
>1. I tried using Chop & chomp.. how ever it doesn't work. Can anyone tell
> me why it doesn't work?
Let's look at the definitions. From perlfunc:
>chomp VARIABLE
>chomp LIST
>chomp
>This is a slightly safer version of chop. It removes any line ending that
>corresponds to the current value of $/ (also known as
>$INPUT_RECORD_SEPARATOR in the English module). It returns the
>total number of characters removed from all its arguments. It's often used
>to remove the newline from the end of an input record when you're
>worried that the final record may be missing its newline. When in
>paragraph mode ($/ = ""), it removes all trailing newlines from the
>string. If VARIABLE is omitted, it chomps $_. Example:
>
> while (<>) {
> chomp; # avoid \n on last field
> @array = split(/:/);
> ...
> }
>You can actually chomp anything that's an lvalue, including an
>assignment:
>
>
> chomp($cwd = `pwd`);
> chomp($answer = <STDIN>);
>If you chomp a list, each element is chomped, and the total
>number of characters removed is returned.
>
>
>chop VARIABLE
>chop LIST
>chop
>Chops off the last character of a string and returns the character
>chopped. It's used primarily to remove the newline from the end
>of an input record, but is much more efficient than s/\n// because
>it neither scans nor copies the string. If VARIABLE is omitted,
>chops $_. Example:
>
> while (<>) {
> chop; # avoid \n on last field
> @array = split(/:/);
> ...
> }
>You can actually chop anything that's an lvalue, including an
>assignment:
>
>
> chop($cwd = `pwd`);
> chop($answer = <STDIN>);
>If you chop a list, each element is chopped. Only the value
>of the last chop is returned.
>
>Note that chop returns the last character. To return all but
>the last character, use substr($string, 0, -1).
So, while chomp clearly would not get rid of the last character, chop
should have and this leads me to beleive that there exists trailing
characters other than '.'.
>2. then I tried using the substituion routine
> $new_url = ~ s/$./ /;
I think you meant to say
$new_url = ~ s/\.$/ /;
I think the '$' should go at the end and you need to quote the '.',
which otherwise matches ANY character (save newlines).
>It also doesn't work. Can anyone please help me on this.
As I think you have more than just a trailing '.' in the string, I
would try
$new_url = ~ s#\.\s*$/##;
HTH
Faust Gertz
Philosopher at Large
------------------------------
Date: Fri, 11 Sep 1998 19:09:16 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Perl "mkdir" function
Message-Id: <35f96ece.619481@news.wwa.com>
On Fri, 11 Sep 1998 13:29:42 +0100, "Darren Hudson"
<darren.hudson@netpoll.net> wrote:
Faust>If you tell us what you want to do, we might be
Faust>able to supply you with better examples.
> i believe i have the correct syntax installed but no new directory is
> created. Not 100% what the $! (errno) relates to.
>
>
> the code that I am using ....
>
> ##################
> # Variables from form #
> ##################
>
> $PollClientCode = "user";
>
> &make_directory;
>
> sub make_directory
> {
> mkdir ("/$PollClientCode/$FORM{'client_name'}", 0666);
> }
>
> I have observed the code that you included in the email that you send....I
> understand whats happening...but slightly confused as to why a new directory
> is not created whilst searching the parent directory ($PollClientCode) on
> the server.
>
> I am clear in what I want?
You should check the return value as was demonstrated in the sample
code.
> mkdir $tmpdir, 0700 or die "can't mkdir $tmpdir: $!";
If the mkdir fails, the script will die and "$!" will tell you why.
My best guess is that your mkdir kernel call can't (won't?) create
more than one level of directory at a time. Use File::Path instead.
>NAME
>File::Path - create or remove a series of directories
>
>--------------------------------------------------------------------------------
>
>SYNOPSIS
>use File::Path
>mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);
>
>--------------------------------------------------------------------------------
>
>DESCRIPTION
>The mkpath function provides a convenient way to create
>directories, even if your mkdir kernel call won't create more
>than one level of directory at a time. mkpath takes three
>arguments:
>
>the name of the path to create, or a reference to a list of
>paths to create,
>
>a boolean value, which if TRUE will cause mkpath to print
>the name of each directory as it is created (defaults to
>FALSE), and
>
>the numeric mode to use when creating the
>directories (defaults to 0777)
>
>It returns a list of all directories (including intermediates,
>determined using the Unix '/' separator) created.
HTH
Faust Gertz
Philosopher at Large
------------------------------
Date: Fri, 11 Sep 1998 18:53:20 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <AkeK1.949$E9.3226998@ptah.visi.com>
In comp.lang.java.programmer bjohnsto_usa_net@my-dejanews.com wrote:
: In article <MmJJ1.591$E9.2050246@ptah.visi.com>,
George Reese <borg@imaginary.com> wrote:
:> : And how is that diffrent to Language? In most cases the languge argument
:> : collapes down to "I like lang X because I think in a style that lang X is
:> : able to express well.".
:>
:> That's a valid comparison.
: But was the selection of example motivated by the fact that this is a
: representative task, or was it because it supported an emotional investment.
That is something left to further investigation. I did not say the
above comparison was conclusive, but that it was valid.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Fri, 11 Sep 1998 18:57:03 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <3oeK1.950$E9.3226998@ptah.visi.com>
In comp.lang.java.programmer bjohnsto_usa_net@my-dejanews.com wrote:
: 'Clean' syntax is some Perl does not want to have. There are plenty of
: lanuages that have it. Perl beat them.
: Perl has convenient syntax. As an experienced programmer I picked up most of
: it in a day. On the other hand most of Python syntax is obvious from my
: experience with 10 other OO languages. I would pick it up quicker than I
: would pick up Perl.
I agree that perl does not want to have clean syntax--in fact, that is
really what it supporters tend to think is so cool about it. My point
is that while that may help the short term productivity of an
individual perl developer, it hurts long term maintainability and thus
no coherent argument can be made to support such a language.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: Fri, 11 Sep 1998 19:24:27 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <LNeK1.958$E9.3226998@ptah.visi.com>
In comp.lang.java.programmer Matt Knecht <hex@voicenet.com> wrote:
: George Reese <borg@imaginary.com> wrote:
:>: Casual perusal of the language also seems to tell me that it's regular
:>: expressions leave a bit to be desired. Maybe that's a good thing for
:>: Python, sice regular expressions are extremely "line noise like". But
:>: they are also incredibly powerful.
:>
:>In my experience, the regular expressions in both languages are
:>identical in function. The Python version just meshes better into a
:>the Python semantics. The Perl version, IMHO, seems like a grafting
:>of line noise into line noise :)
: Well, at least there was a smiley. Let me clarify that a bit more. It
: seems that to use a regex you need to make a function call. They seem
: grafted onto the language, and don't enjoy the first class treatment
: that Perl regular expressions do. I can use a regular expression
: in almost any place in Perl. Python seems to be limited to:
: pat = re.compile('[0-9]+')
: m = pat.match(strvar)
: if m == None: print 'No match'
: Which is terrbily logn winded to me, and doesn't seem to be able to be
: integrated in other contrusts. I find 'if (/\d+/)' much simpler. And I
: can use that regex anywhere I want (In an if, in a grep, map, alone by
: itself on a line (No much use with a match, but with a substitution,
: very useful), the list goes on and on).
Both are functionally equivalent. What you call long-wided is fitting
into the OO semantics of python. Perl, on the other hand, just shoves
the semantics of at least half a dozen programming languages and tools
together. That lacks serious cohesion.
:>As a C programmer, you had an advantage--you were used to dealing
:>with hard to maintain code.
: I'm not sure how to respond to this. If you remove all the problems
: that deal with memory allocation, my C code wasn't hard to maintain. I
: wrote it that way on purpose (Well, most of the time anyway.).
: To maintain it, though, you did need a good understanding of the
: language. Without that, forget it.
C is hard to maintain beyond memory issues (and perl still has memory
issues, as does python or Java--just with perl it takes more talent to
construct your apps so that the memory issues are not so important).
C, like perl (but to a much lesser extent), encourages horrid
obfuscation. There is also the fact that the programming paradigm of
C is not condusive to maintainability and extensibility--thus the
advent of C++. But just as C++ was a horrid attempt at
objectification of a lost cause, so was perl5 a horrid attempt at
objectification of a lost cause.
:>Furthermore, my claim comes from
:>discussing this with people skilled at both perl and python
:>programming and with experience at getting people who know neither to
:>learn them. While that is not a formal study, I have quite honestly
:>never met someone who was experienced with both languages who did not
:>think the difference in maintainability between the two was like night
:>and day.
: Others have spoken on this, and I'll add my voice to the choir. I have
: very littel difficulty maintaining Perl code, as long as it wasn't
: written by an idiot, or a hacker-wannabe.
To the choir? You have a few people who have emotional attachments to
the language.
:>: Meaningfully? No. I may have inferred what was not there, though.
:>: Phrases like "Perl is its polar opposite--some of the >hardest to
:>: maintain and extend code on earth" tend to put me on the defensive (As
:>: I'm sure others have felt). Those are fighting words, pilgrim!
:>
:>On the defensive? Why would you get defensive about a programming
:>language?
: Because I love Perl! It's reminded me why I got into this field. It's a
: joy to program in. As you said before "It's my pet language". It may
: not be rational or logical (The statement, not the language), but man I
: love it!
I am sorry, I fail to see how a language is something one should get
emotionally atatched to. Either it is the best tool for the job, or
it isn't.
:>I do think the degree to which perl is disaparaged foor its
:>unreadability should be something that strikes you like a neon sign in
:>the dead of night.
: I don't often (ever) read critques of languages, so I'm not sure what has
: been written about it being hard to maintain.
: In my own opinion, I find perl to be very easy to maintain and expand.
That question goes beyond your own personal experience into team
dynamics. I would agree, for perl experts with little or no python
experience, perl is a lot more maintainable. But that is a really
silly caveat when evaluating the comparative merits of two languages.
[ some agreements omitted ]
:>The ideal programming language would be
:>a human language at a 5th grade reading level.
: Aha! I believe this is where we'll never see eye to eye. I totally
: disagree with this statement. Computers are complex. They can do
: complex things. It is very difficult to express concise instructions in
: a fifth grade reading level.
That is a very narrow view of things. First, I used fifth grade just
as a number. I did not want the reply of someone coming back and
saying 'so you think Hegel is easier to read than perl. No, I think
horribly obfuscated perl is easier to read than Hegel :)
The point was that a computer should be able to understand our natural
language and that somehow or another we should be forced to express
our desires in natural language that everyone else can make sense of.
To your objection that computers are complex I have to laugh.
Computer languages are infinitely simpler than human languages. They
are designed to enable a human to express their desires in a format
understandable by simple minded computers--yes, computers are very
simple minded, they are not at all complex.
Computer languages are just a simplification of human languages.
:>Unfortunately, human
:>languages are notoriously ambiguous and hard to compute.
: While I agree with this statement, I don't understand what you are
: getting at. Are you saying Python is written to be understood on a
: fifth grade level (I know you obviously don't mean this literally)? Are
: you saying that this is Python's goal?
No, I was stating that Python comes in a format that is more natural
to human expression without the ambiguities of natural languages.
:>No, it is not. My claim makes sense. Perl is often a string of
:>non-alphabetic characters that have contextual meaning (often used
:>without any respect to how we use them in normal discourse) and laced with
:>implied behaviour. That you cannot deny. And all of those things
:>renders it hard to read.
: I don't deny it. And, I agree. To anyone who doesn't know the
: language, it can be very difficult to read. But, after a week of
: reading _Learning_Perl_, those characters and contexts begin to fall
: into place. Once you understand the rules, it is a very elegant and
: concise language.
: But shoudl the bar be set that low? Why cripple a language by forcing
: it to stay within the bounds of normal discourse? Nobody makes these
: claims refuting mathmatics. Nobody makes these claims refuting physics.
: Sure, both could be set to the English (Or any other) language, but it
: would make them incredibly muddled. I don't think that giving a
: language more expressive power (Through the use of symbols that have no
: concise equivalent in human language) is a bad thing... in fact, I think
: it's a fantastic thing. Perhaps this is where you'll never agree.
It applies bizarre meanings to things that have very different
meanings in other contexts. Furthermore, perl enables about a million
different ways of doing the very same thing. It gives people a lot of
rope with which to hang themselves. That, IMHO, is always bad and one
of the greatest strengths of both Python and Java.
In order to read perl code, you have to understand a lot more than the
basics of the language--you have to understand the programming style
of the original author.
:> Excessive
:>whitespace? Only someone who believes in terseness would argue that.
:>The whitespace clarifies program blocks--you are never in doubt in
:>python where the program blocks lie.
: Perhaps. But I would prefer not to be constrained by whitespace, but to
: use it how I see fit. This part of Python still gives me the willies.
: I love the fact that I can bounce around in my editor from opening and
: closing statements with the mere strike of one key. Having to find the
: opening and closing of a Python statement seems like it would be work.
: I know I'd quickly forget what tag was where. To me, braces are an
: *extreme* help in maintaing and editing code.
How do braces help that? Moving to the end of the block is a function
of an editor, not a language. Emacs handles both languages just
fine. Python simply makes it easier to find blocks just through
glancing.
:>I don't know where you get
:>periods, but anyone with any programming experience should be able to
:>see immediately what the colons mean.
: Well, help me out then! What is going on here? (Taken from the de-tab
: program I cited earlier)
: pos = col + endspace.search( str[col:col+tabsize] )
: I've looked at this line quite a bit, and still don't see what col:col
: means. I hope I don't fail the fifth grade! :)
Heh, ok, I was thinking more along the lines of:
foreach item in list:
I think .. would probably make more sense in this instance than does
the :, but basically it means take a substring starting at the
specified index and of the specified length (or subarray).
I am certainly not claiming Python is perfect!
:>If it comes out looking like something only a perl expert could read,
:>it is no good.
: Just because it contains non-alphanumeric characters doesn't mean it
: takes an expert. I'm no Perl expert. Most of the people who read
: comp.lang.perl.misc are no experts. I know many Perl programmers, and
: not a single expert. Much of what we talk about you would label expert
: only. Are you raising us to the level of expert, or lowering the value
: of being an expert?
s/expert/programmer
: I think you're mistaking the fact the you do need to know a bit about
: the language before you can use it well. A neophyte Perl programmer is
: going to have a lot of problems. Is this a bad thing? I don't think
: so. It is the cost of increased flexibilty and power that Perl offers.
I think it is a bad thing. The goal should be to maintain the power
while lowering the learning curve. And, my claim is that Python does
that. It has the full power of perl with a much smaller learning curve.
:>Python has tons of modules as well. And software reuse does not make
:>something OO. Perl IS NOT OO. It just added some OO constructs as an
:>afterthought. I invite you to check out http://www.python.org.
: I have. Many times. And many more times since this thread has started.
: Python looks like a decent language. It looks like I'll be learning it
: earlier than I expected because of this. Although I don't know how I'm
: ever going to feel comfortable with the lack of braces around
: constructs... that seems like a very nasty limitation to me.
Honestly? My gut reaction was the same as yours. It grows on you :)
I think that is cause we come from C-ish backgrounds that we have that
reaction though. Fewer and fewer people these days have C in their
background.
: Oh, and one last point. A line from the Python FAQ that had me laughing
: for quite some time:
: 3. Building Python and Other Known Bugs
: It seems as though the Python developers are telling us Python is a bug!
: Too funny! :)
Heh.
--
George Reese (borg@imaginary.com) http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
"Keep Ted Turner and his goddamned Crayolas away from my movie."
-Orson Welles
------------------------------
Date: 11 Sep 1998 15:11:41 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl gurus opinion needed.
Message-Id: <6tbsld$5nf$1@monet.op.net>
In article <6tbp40$eqo$1@blackice.winternet.com>,
Doug Wheeler <dwheeler@isd.net> wrote:
>It seems (from some quick research) that all the "hacks" relating to being
>available for hire (cabs, horses, etc.) are derived from "hackney." All the
>forms relating to unskilled cutting (and other unskilled work) are from the
>word "hack." I would definitely put computer hacker (and hack writer) into
>the second category.
`Computer hacker' may be a matter for speculation, but `hack writer'
is not. `Hack writer' is derived from `hackney' (== cab) and not from
`hack' (== hoe, cut up) regarless of whether you would categorize it
that way or not.
------------------------------
Date: 11 Sep 1998 19:13:24 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: SPSS and PERL
Message-Id: <6tbsok$oc8$1@msunews.cl.msu.edu>
Danny J. Sohier <danny@spiff.bibl.ulaval.ca> wrote:
Thank you so much for posting the same message 8 times.
-dan
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: 11 Sep 1998 19:45:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Stripping out 'bad' HTML
Message-Id: <6tbukq$gan$1@client3.news.psi.net>
Jeremy Goldberg (jgoldberg@dial_put-a-decimal-here_pipex.com) wrote on
MDCCCXXXVII September MCMXCIII in <URL: news:6tb8gm$9g$1@plug.news.pipex.net>:
++
++ 'Bad' html as in the user inputting information possibly not having a clue.
++ I didn't mean legal or illegal HTML, I meant picking out innocent mistakes -
++ like the "3 < 5" above - from deliberate HTML. Actually, of course, most
++ browsers will accept "3 < 5" (does the syntax explicitely ignore a '<'
++ followed by a number?)... but what about:
I don't know about you, but there is no number following < in "3 < 5".
++ a < b
++ a < b < c
++ Price: <no data>
++ Mail me at <a href="mailto:ditto@diggity.com">ditto@diggity.com</a>
++
++ Only the last is meaningful HTML. You see what I'm getting at?
No. You fail to understand. Get a clue. Both "a < b" and "a < b < c" are fine.
It's not a matter of "browsers accepting". It's a matter of SGML definitions.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3695
**************************************