[9998] in Perl-Users-Digest
Perl-Users Digest, Issue: 3591 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 30 17:04:34 1998
Date: Sun, 30 Aug 98 14:00:24 -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 Sun, 30 Aug 1998 Volume: 8 Number: 3591
Today's topics:
Re: Accessing remote computers throught RSH <rootbeer@teleport.com>
Another RexX Question. chad@gurucom.net
Re: Better Regular Expressions (was: Re: Imagine... a n <uri@sysarch.com>
Better Regular Expressions (was: Re: Imagine... a non-g <rootbeer@teleport.com>
Re: Better Regular Expressions (was: Re: Imagine... a n (Ilya Zakharevich)
Building Perl 5.004_xx under Linux <jet@accessone.com>
Re: Change NT IP Address Using Perl (Chris Benson)
Re: dynamic library libperl.sl for HP-UX man2@my-dejanews.com
Re: Hats off to Tom Phoenix (Norman UNsoliciteds)
Help with fork() and pipe() (Malcolm Hoar)
Re: Imagine... a non-greedy world! <mee@mine.com>
Re: Imagine... a non-greedy world! <mds-resource@mediaone.net>
Re: Imagine... a non-greedy world! (Michael Rubenstein)
Re: Imagine... a non-greedy world! (Craig Berry)
Re: Imagine... a non-greedy world! <dgris@rand.dimensional.com>
Re: Imagine... a non-greedy world! <mee@mine.com>
Re: Imagine... a non-greedy world! <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Imagine... a non-greedy world! <minich@globalnet.co.uk>
Re: Imagine... a non-greedy world! <dgris@rand.dimensional.com>
Re: Memory Problem, Please Help. (Ilya Zakharevich)
Re: mod (%) operator oddities with large integers <mds-resource@mediaone.net>
Re: Perl compiler <alf@orion.it>
Perl Master Needed realworld6@yahoo.com
Re: perl regex bug? (or feature?) pete@theory2.phys.cwru.edu
Re: Q: remain order, hash (Jonathan Stowe)
Re: WANTED: 3rd level domain script <rootbeer@teleport.com>
Re: what's wrong with this statement? <vincent@compclass.com>
Re: what's wrong with this statement? <vincent@compclass.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 30 Aug 1998 17:42:54 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Accessing remote computers throught RSH
Message-Id: <Pine.GSO.4.02A.9808301038400.14995-100000@user2.teleport.com>
On Sun, 30 Aug 1998, Patrick Boucher wrote:
> I have to garner results of the 'ps -eaf' and 'who' commands on a
> remote computer. I thought of using this with the usr/bin/rsh command.
> Is there a way to use rsh to get this information, capture the result
> code of the rsh execution AND the return of the executed command?
It sounds as if you wish to make an external program do what you want. Of
course, you do this in the same way whether the calling program is written
in Perl, C, or in any other language. Perhaps the docs, FAQs, and
newsgroups about rsh and related issues could help you.
But maybe you're needing to know in Perl how to capture the output of the
command and also to get its exitstatus. In that case, you probably want to
read about qx`` and $? in the perlop and perlvar manpages. Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 30 Aug 1998 18:41:08 GMT
From: chad@gurucom.net
Subject: Another RexX Question.
Message-Id: <6sc6c4$u29$1@nnrp1.dejanews.com>
Hi,
ok this works fine:
@links = $content =~ /<li><a href="http:\/\/(.*?)">(.*?)<\/a>(.*?)</i
and saves the URL, TITLE and DESCRIPTION in the @links array, but I want a
new line '\n' after the description. How do I do that? So it come out like
this:
URL TITLE DESCRIPTION
URL TITLE DESCRIPTION
URL TITLE DESCRIPTION
etc ...
thanks,
-chad
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 30 Aug 1998 15:33:44 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Better Regular Expressions (was: Re: Imagine... a non-greedy world!)
Message-Id: <x7ogt22rjb.fsf@sysarch.com>
>>>>> "TP" == Tom Phoenix <rootbeer@teleport.com> writes:
TP> On Sun, 30 Aug 1998, Mee wrote:
>> I frequently have to write huge and uninteligible expressions, similar
>> to my example string, to make Perl do what even a flatworm would
>> understand as a logical thing.
TP> Clearly, you believe that there's a better way to write regular
TP> expressions than the one now in Perl. Well, we all know that Perl isn't
TP> perfect, so I can believe you.
do we? :-)
TP> So, with satisfying those three points in mind, could you please tell us
TP> what you have in mind? I'm sure many of us would like to see a better way
TP> to do regular expressions. Please, though, be specific. We all know that
TP> it could be better, but we need someone to show us how it _would_ be
TP> better. Thanks!
from anyone else i would assume this was sarcastic, but from you i am
not sure!
mee is too cught up in his ignorance to do your request justice. he has
never posted a real regex he has trouble with, just line noise. he
obviously doesn't understand them so how could he improve their design.
we have repeatedly asked him for details/examples of his complaints but
to no avail. he must need giant regexes to do hos job. i'd wager anyone
of us could rewrite his regexes (if they actually exist) to be shorter,
faster, clearer that his, with very little difficulty.
so let's stop answering this twit until he puts up some code or shuts
up!
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Sun, 30 Aug 1998 18:30:26 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Better Regular Expressions (was: Re: Imagine... a non-greedy world!)
Message-Id: <Pine.GSO.4.02A.9808301047190.14995-100000@user2.teleport.com>
On Sun, 30 Aug 1998, Mee wrote:
> I frequently have to write huge and uninteligible expressions, similar
> to my example string, to make Perl do what even a flatworm would
> understand as a logical thing.
Clearly, you believe that there's a better way to write regular
expressions than the one now in Perl. Well, we all know that Perl isn't
perfect, so I can believe you.
It wouldn't be impossible to add to Perl an additional RE engine which
would work in a better way. All old patterns would still work as they
always have, but it would be easy to write new patterns along the lines of
your suggestion.
Of course, this would take some work to add and maintain, and some are
already complaining that Perl is too big. In order to convince Larry and
the others that this sort of thing should be added to Perl, we'll need to
have some persuasive evidence. We don't need to have rock-hard evidence
proving every single point I've listed here, but we would need to raise
some hopes that this would be worth the effort.
1. Some (commonly-needed) patterns must be significantly easier
to write, read, or maintain than they are now.
We should have several examples of patterns which are very difficult today
and which would be a snap under the new system.
2. No patterns should be significantly harder to write,
read, or maintain than they are now.
This implies that any old pattern should have a corresponding new one. In
fact, if a program could translate from the old to the new, that would be
even better.
3. The implementation should be roughly as fast as the current
one.
It could be a trifle slower, with the hope that it would be improved in
the future. But if it were significantly slower, that would be a problem.
We should be able to prove that there are no difficulties involved in
compiling each part of the pattern to efficient machine code.
So, with satisfying those three points in mind, could you please tell us
what you have in mind? I'm sure many of us would like to see a better way
to do regular expressions. Please, though, be specific. We all know that
it could be better, but we need someone to show us how it _would_ be
better. Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 30 Aug 1998 20:34:11 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Better Regular Expressions (was: Re: Imagine... a non-greedy world!)
Message-Id: <6scd03$g9d$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Tom Phoenix
<rootbeer@teleport.com>],
who wrote in article <Pine.GSO.4.02A.9808301047190.14995-100000@user2.teleport.com>:
> It wouldn't be impossible to add to Perl an additional RE engine which
> would work in a better way.
Starting from v5.005 this is supported and documented.
L<perlre/Creating custom RE engines>. From this point on no
complaints about the *syntax* of RE is acceptable. The purpose of
Perl's RE engine now is to provide functionality, and whoever wants
better syntax may create it in several minutes.
(Well, in fact the *functionality* part of RE engine is also
switchable - up to some extent - this is what -Mre=debugcolor is
doing.)
Ilya
------------------------------
Date: Sun, 30 Aug 1998 13:20:52 -0700
From: Eric Thompson <jet@accessone.com>
Subject: Building Perl 5.004_xx under Linux
Message-Id: <35E9B424.6316E4E5@accessone.com>
I am having trouble building Perl under Linux. Evidently I am
bombing out on libnet, which I did not have on my system and built
successfully before attempting to run Configure. I ran ldconfig before
running Configure, so am somewhat perplexed as to why I am not linking
successfully to it.
I had one unusual comment from Configure, when checking my compiler I
got the comment "Hmmm, this doesn't look like a MIPS system!" What could
be causing that?
I built Pel 5.002 without any problem on this system.
Following is output from Configure:
Checking your choice of C compiler, libs, and flags for coherency...
I've tried to compile and run a simple program with:
gcc -O2 -Dbool=char -DHAS_BOOL -I/usr/local/include
-L/usr/local/lib -o try try.c -lnet -lgdbm -ldbm -ldb -ldl -lm -lc
./try
and I got the following output:
/usr/local/lib/libnet.so: undefined reference to `sysAcceptFD'
/usr/local/lib/libnet.so: undefined reference to `makeJavaString'
/usr/local/lib/libnet.so: undefined reference to
`java_io_FileDescriptor_initSystemFD'
/usr/local/lib/libnet.so: undefined reference to `sysCloseFD'
/usr/local/lib/libnet.so: undefined reference to `sysSocketInitializeFD'
/usr/local/lib/libnet.so: undefined reference to `sysListenFD'
/usr/local/lib/libnet.so: undefined reference to `FindClassFromClass'
/usr/local/lib/libnet.so: undefined reference to
`java_io_FileDescriptor_sync'
/usr/local/lib/libnet.so: undefined reference to `sysRecvfromFD'
/usr/local/lib/libnet.so: undefined reference to `sysSendFD'
/usr/local/lib/libnet.so: undefined reference to
`execute_java_constructor'
/usr/local/lib/libnet.so: undefined reference to `sizearray'
/usr/local/lib/libnet.so: undefined reference to `EE'
/usr/local/lib/libnet.so: undefined reference to `sysRecvFD'
/usr/local/lib/libnet.so: undefined reference to `is_instance_of'
/usr/local/lib/libnet.so: undefined reference to `javaString2CString'
/usr/local/lib/libnet.so: undefined reference to
`java_io_FileDescriptor_valid'
/usr/local/lib/libnet.so: undefined reference to `sysSendtoFD'
/usr/local/lib/libnet.so: undefined reference to
`java_lang_String_intern'
/usr/local/lib/libnet.so: undefined reference to `sysConnectFD'
/usr/local/lib/libnet.so: undefined reference to `FindClass'
/usr/local/lib/libnet.so: undefined reference to `SignalError'
/usr/local/lib/libnet.so: undefined reference to `ArrayAlloc'
/usr/local/lib/libnet.so: undefined reference to `sysTimeoutFD'
/usr/local/lib/libnet.so: undefined reference to `sysSocketAvailableFD'
I can't compile the test program.
Any suggestions appreciated.
Thank you.
Eric
------------------------------
Date: 30 Aug 1998 19:42:13 +0100
From: chrisb@jesmond.demon.co.uk (Chris Benson)
Subject: Re: Change NT IP Address Using Perl
Message-Id: <6sc6e5$8ko@jesmond.demon.co.uk>
In article <363a0f5c.1167585439@nntpd.databasix.com>,
Bill <wmcclatc@primenet.com> wrote:
>For some reason on 19 Aug 1998 21:10:08 +0100,
>chrisb@jesmond.demon.co.uk (Chris Benson) babbled:
>
>>In article <01bdcac7$f31b57c0$636c8bd0@wkchiu>,
>>wkchiu <wkchiu@yahoo.com> wrote:
>>>Reboot is required in NT4.0 but not NT3.51
>>>
>>Actually NT4.0/workstation not required.
>
>Someone should tell my copy this. Whenver I change the info I get a
>message infoming that a reboot is needed for changes to come into
>effect.
Maybe a difference in Service Packs ?? Bare 4.0 is IME as I said
(I have to setup a roomful of them occasionally), SP3 is supposed
to fix many things -- maybe they took the chance to enforce *another*
reboot?
--
Chris Benson
------------------------------
Date: Sun, 30 Aug 1998 17:41:47 GMT
From: man2@my-dejanews.com
Subject: Re: dynamic library libperl.sl for HP-UX
Message-Id: <6sc2sr$q2c$1@nnrp1.dejanews.com>
> there seems to be rather hopeless linking problems in
> my HP-UX environment (HP-UX B.10.20 A 9000/755) and
> it might be a bit less hopeless it there is a
> libperl.sl (shared library) available instead of libperl.a.
> I'm using perl 5.004.
I got the library I needed by re-compiling/installing perl.
The library that I intent to use is called Cadim.sl. I managed
to install it using swig and MakeMaker. Now I've got "use Cadim;"
as the first line on my test script. But I get a strange error
message from perl autoloader when I try to run the script:
Can't load '<correct path>/PA-RISC1.1/auto/Cadim/Cadim.sl' for module Cadim:
No such file or directory at <my home>/perl/lib/perl5db.pl line 1134.
Yet, there is the file required:
file <correct path>/PA-RISC1.1/auto/Cadim/Cadim.sl:
<correct path>PA-RISC1.1/auto/Cadim/Cadim.sl: s800 shared library -not
stripped
perl is situated in my home directory under "perl" and the library
was installed using "make install". Is there something I missed?
Yours,
Marko
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Mon, 31 Aug 1998 04:15:51 +0900
From: No.unsoiliciteds@dead.end (Norman UNsoliciteds)
Subject: Re: Hats off to Tom Phoenix
Message-Id: <No.unsoiliciteds-3108980415520001@cs11i47.ppp.infoweb.or.jp>
In article <35e873b9.41338532@news.btinternet.com>,
Gellyfish@btinternet.com (Jonathan Stowe) wrote:
> Thats Tom P. for you. Year on winner of the "nicest man on the
> Newsgroup" award. But maybe the magnanimity is a form of satire: have
> you thought of that?
It's possible, I have seen Abbigail's flamings interpreted as helpful yet
dispassionate advice ;)
--
The Dinosaurs were so stupid, they couldn't
even devise the means of thier own extinction,
they had to wait for Nature to do it for them.
------------------------------
Date: Sat, 29 Aug 1998 18:13:49 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Help with fork() and pipe()
Message-Id: <6s9gcs$k72$1@nntp1.ba.best.com>
I have a Perl application where a parent fork()'s multiple
children and then communicates with them via a pair of
pipe()'s.
At rare and random times (but, it's *definitely* more
frequent under high system load) the data returned from
the children gets totally garbled. Shortly thereafter,
everything locks up. ps -l shows all the children hanging
on WCHAN=pipwdc. The parent on WCHAN=pipewr.
It's not a classic 'deadlock' and the pipe is not broken
(as in SIG PIPE). The children do not die and they are not
zombied/defunct. I have verified that good data is being
piped to the children. The children appear to receive the
good data and process it correctly. But garbage is piped
back to the parent for a while before everything hangs.
I have studied and followed (as far as I can tell) all the
recommendations and examples in the Camel and perlipc with
regard to fork(), pipe(), SIG etc.
Does anyone have any idea what this might be or, more
likely, any suggested strategies for tracking it down?
Also, is it likely that a socketpair would be more robust
than the pipe?
Environment:
FreeBSD 2.2.7-RELEASE .....
This is perl, version 5.005_01 built for i386-freebsd
Also seen on 5.004_04.
--
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar "The more I practice, the luckier I get". |
| malch@malch.com Gary Player. |
| http://www.malch.com/ Shpx gur PQN. |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Sun, 30 Aug 1998 09:46:06 -0700
From: Mee <mee@mine.com>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <35E981CE.4844AE59@mine.com>
Michael,
You do not get it either do you?
When I type a long string of random characters
to convey the point, you analyze it for syntax!
Are we still in Kansas?
If you reread my original post you will find that
greediness is much more than aesthetical problem.
It is not just about adding one stinking qualifier (?).
I frequently have to write huge and uninteligible
expressions, similar to my example string, to make
Perl do what even a flatworm would understand as a
logical thing.
I can only imagine a shock and disbelief that some
poor slob is sure to experience when s/he opens these
programs to make changes and sees those Godzilla
expressions.
You think you made a serious typo in your first post?
I am sure that that's only natural to Perl
because Perl itself is just one big typo.
Mee
------------------------------
Date: Sun, 30 Aug 1998 12:49:01 -0500
From: "Michael D. Schleif" <mds-resource@mediaone.net>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <35E9908D.90B3CE7C@mediaone.net>
Dear Mee (_not_ myself,) please, _do_not_ under any circumstances use
the Perl language. You, dear Mee (_not_ myself,) are far more advanced
than this simpleton's programming language -- why do you _not_ use your
head -- why do you need a computer?
Actually, to us mere mortals, to whom Perl is useful, your pathetic
ramblings appear to be ``huge and uninteligible expressions'' . . .
Maybe you, Mee (_not_ myself,) should try Lisp? Or Prolog? Or, or,
COBOL?
Please, please, STOP your whining! The blinding flash hurts my mortal
eyes . . .
Mee wrote:
>
> Are we still in Kansas?
>
> I frequently have to write huge and uninteligible
> expressions, similar to my example string, to make
> Perl do what even a flatworm would understand as a
> logical thing.
>
> I am sure that that's only natural to Perl
> because Perl itself is just one big typo.
>
> Mee
--
Best Regards,
mds
mds resource
888.250.3987
"Dare to fix things before they break . . . "
"Our capacity for understanding is inversely proportional to how much we
think we know. The more I know, the more I know I don't know . . . "
------------------------------
Date: Sun, 30 Aug 1998 17:55:57 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Imagine... a non-greedy world!
Message-Id: <35ee91e7.400303145@nntp.ix.netcom.com>
On Sun, 30 Aug 1998 09:46:06 -0700, Mee <mee@mine.com> wrote:
>Michael,
>
>You do not get it either do you?
>When I type a long string of random characters
>to convey the point, you analyze it for syntax!
>Are we still in Kansas?
>
>If you reread my original post you will find that
>greediness is much more than aesthetical problem.
>It is not just about adding one stinking qualifier (?).
>I frequently have to write huge and uninteligible
>expressions, similar to my example string, to make
>Perl do what even a flatworm would understand as a
>logical thing.
>
>I can only imagine a shock and disbelief that some
>poor slob is sure to experience when s/he opens these
>programs to make changes and sees those Godzilla
>expressions.
>
>You think you made a serious typo in your first post?
>I am sure that that's only natural to Perl
>because Perl itself is just one big typo.
I'm afraid that if you think that programming consists of typing
random characters there's little I can do to help you.
Have a nice day.
--
Michael M Rubenstein
------------------------------
Date: 30 Aug 1998 17:57:40 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Imagine... a non-greedy world!
Message-Id: <6sc3qk$ibm$1@marina.cinenet.net>
Mee (mee@mine.com) wrote:
: You do not get it either do you?
: When I type a long string of random characters
: to convey the point, you analyze it for syntax!
: Are we still in Kansas?
Wouldn't an actual example do more to establish your position? Comparing
valid syntax with line noise just confuses your audience.
: If you reread my original post you will find that
: greediness is much more than aesthetical problem.
Given that Perl provides the choice between greedy and non-greedy
matching, I (and others) still have no clue what you're complaining about.
: It is not just about adding one stinking qualifier (?).
If it's not, please tell us why. (And notice that ? in the sense you're
using it isn't a quantifier all by itself, but rather a modifier of an
immediately preceding quantifier.)
: I frequently have to write huge and uninteligible
: expressions, similar to my example string, to make
: Perl do what even a flatworm would understand as a
: logical thing.
Again, a real example would help here. Perhaps you're not crafting your
regexes well. Perhaps you are trying to match patterns which are
intrinsically complicated. Perhaps you have come up with a new way to do
Perl regexes which can be introduced to the language. Without specifics,
there's no way for us to tell.
---------------------------------------------------------------------
| 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: Sun, 30 Aug 1998 18:38:57 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <6sc5el$hbv$1@rand.dimensional.com>
In article <35E981CE.4844AE59@mine.com>
Mee <mee@mine.com> wrote:
>If you reread my original post you will find that
>greediness is much more than aesthetical problem.
I am going to assume for a moment that you are serious
about this, and not just trolling clpm.
If this is indeed the case, could you provide an example
of how you think regular expressions _should_ work? I
have a feeling that you are suffering some profound
misunderstanding of what a regular expression is and
what it does (although the links Tom C. posted should
help you out), and that nobody is understanding your
complaint because of this.
Rather than continuing with pointless perl bashing it
will be more constructive to figure out what you are
actually unhappy with. As far as I can tell, your problem
stems from-
1. You want (*) to mean what (.) currently means
2. You cannot accept that (*?) is a single quantifier
3. You want (*) and (+) to default to the current behavior
of (*?) and (+?), except that you want a bare (*) to
match the current meaning of either (.*?) or (.+?) [I'm
completely unsure about this, though, because you've yet
to form a coherent sentence on the subject]
All of these seem to boil down to a perceived failure in the
notation used to denote regular expressions in perl. This is
a fair complaint, and one that I am inclined to agree with
in some senses. I do believe that the current notation is
cumbersome and difficult to master, and that a simpler notation
would make regular expressions easier to teach, learn, and
understand. (Devising said notation is an exercise left to
the reader :-)
But calculus also has a complex and difficult to understand
notation, as does music, language, and every other symbolic
system we have designed to communicate abstract ideas. Some
topics are just plain complicated, and there is no way around
that.
Yet you allege that your complaint is based upon something
other than aesthetic concerns, which seems to rule out
complaints based upon the notation used for regular expression
in perl.
Unfortunately, you have said nothing that indicates what this
other complaint may be. If you can express what it is that
actually bothers you, and if you can do it without gratuitous
perl bashing, I am sure there are people here who will be
willing to help you understand this topic.
dgris
- btw, the links Tom posted didn't seem (IMO) intended to make
you feel stupid as they were all relevant to the issue that it
seems you are raising
--
Daniel Grisinger dgris@perrin.dimensional.com
`Train of thought derailed. 7 dead, film at 11.'
------------------------------
Date: Sun, 30 Aug 1998 12:00:44 -0700
From: Mee <mee@mine.com>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <35E9A15C.1AA43924@mine.com>
Daniel,
Most of the defenses of Perl present here boil down
to either some supposedly theoretical basis or a
desire to preserve compatibility or tradition.
There is absolutely nothing in any theory that
sez that regex must be greedy, or that one
character (eg: ^) must mean different things in
different contexts, or ... I could go on forever.
As for the compatibility/tradition argument:
Perl designers have chosen to copy some stuff
verbatim, implement some stuff in a different
way, and turn some traditional constructs
upside-down.
I see absolutely no coherence in what was
placed in which bag and that is why Perl has
ended up being the Frankenstein of languages.
Mee
------------------------------
Date: 30 Aug 1998 21:44:32 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <7x67facl0f.fsf@haze.vcpc.univie.ac.at>
Re: Imagine... a non-greedy world!, Mee <mee@mine.com>
said:
Mee> ... I could go on forever.
Yes, I was beginning to get that feeling reading your
posts. You're a troll, go away...
Mee> is why Perl has ended up being the Frankenstein of
Mee> languages.
This is so obviously flame-bait. You're a troll, go away...
------------------------------
Date: Sun, 30 Aug 1998 20:46:01 +0100
From: "Martin" <minich@globalnet.co.uk>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <6sca50$pdt$1@heliodor.xara.net>
>There is absolutely nothing in any theory that
>sez that regex must be greedy, or that one
>character (eg: ^) must mean different things in
>different contexts, or ... I could go on forever.
It has to be either greedy or non-greedy and, since
greedy is probably used more, then that's the default.
It may be a better idea to have a letter to invert this,
say j, that you just stick on the end of the closing delimiter
as you would a sigeo etc.
Martin
------------------------------
Date: Sun, 30 Aug 1998 19:56:57 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: Imagine... a non-greedy world!
Message-Id: <6sca1e$hfc$1@rand.dimensional.com>
In article <35E9A15C.1AA43924@mine.com>
Mee <mee@mine.com> wrote:
>Most of the defenses of Perl present here boil down
>to either some supposedly theoretical basis or a
>desire to preserve compatibility or tradition.
I have seen no arguments that greedy matching is due
to backwards compatibility or tradition (that isn't
to say that someone hasn't made such an assertion,
I haven't followed this thread closely enough to say).
>There is absolutely nothing in any theory that
>sez that regex must be greedy
Citation please.
(And no, that isn't meant to be a snotty demand. I am
currently attempting to understand the mathematical
basis for regular expressions and this statement seems
to contradict the references I have available. But
again, I am not yet an expert here and I appreciate all
references that will help me to fully grok this topic).
> or that one
>character (eg: ^) must mean different things in
>different contexts, or ... I could go on forever.
This is a notational issue which you have clearly stated
in this thread is not a concern you have. Or has
your argument changed to `I don't like the notation
that perl uses'?
>As for the compatibility/tradition argument:
Please give me the message ids of the articles that
contain this argument.
>Perl designers have chosen to copy some stuff
>verbatim, implement some stuff in a different
>way, and turn some traditional constructs
>upside-down.
Since you are making an issue of backward compatibility
I'd like for you to provide an example of a regular
expression implementation with a fundamentally different
notation than that which perl uses. To make your case
actually relevant the implementation that you use as
an example should either be in more widespread use than
perl, or it should have been a common implementation at
some time in the past.
>I see absolutely no coherence in what was
>placed in which bag and that is why Perl has
>ended up being the Frankenstein of languages.
We are not discussing perl as a whole, but rather
perl's specific regular expression implementation.
I, personally, find perl's regular expression
implementation to be very similar to every other
implementation that I normally use.
The dissimilarities seem only to arise in cases where
perl provides more expressive constructs than do
other implementations. Most people consider this a
feature, not a bug.
dgris
- I'm even more convinced now that you are trolling.
Please don't bother to reply if you are not going
to provide citations, preferably to references
containing mathematical proofs of your claims
concerning greediness or to source code for regular
expression implementations that provide far different
semantics than perl and that were at one point in
wide enough usage to be now accepted as defining the
`traditional' way of doing things.
--
Daniel Grisinger dgris@perrin.dimensional.com
`Train of thought derailed. 7 dead, film at 11.'
------------------------------
Date: 30 Aug 1998 18:09:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Memory Problem, Please Help.
Message-Id: <6sc4gb$8lr$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to
<chad@gurucom.net>],
who wrote in article <6sc1ht$o8m$1@nnrp1.dejanews.com>:
> I have been writing perl scripts for many years but still consider myself a
> newbee, there are just so many things you can do with it, i'm still learning.
> So I need alittle help. I have this script that runs for a very long time as
> it should except it eating up memory and it should'nt. Is there away besides
> looking at 'ps' or 'top' to figure out better what's going on? Does perl
> have a 'special variable' that tell about memory usage of the running script?
perldoc perldebug
of 5.005 may be entertaining.
Ilya
------------------------------
Date: Sat, 29 Aug 1998 13:29:56 -0500
From: "Michael D. Schleif" <mds-resource@mediaone.net>
Subject: Re: mod (%) operator oddities with large integers
Message-Id: <35E848A4.33752497@mediaone.net>
This begs a very important question: How big is big?
As a rule of thumb, where is this threshold? What is that number above
which, to be safe, we should apply Math::BigInt and below which we
needn't bother?
Zenin wrote:
>
> Dan McCormick <danmcc@metro.net> wrote:
> : Can anyone provide any insight into this odd occurrence:
> >sniped and moved around a bit<
> : My first assumption that I was pushing perl's integer limits seems to be
> : refuted by
> : $ perl -e 'print 34259873425 + 34259873425'
> : 68519746850
>
> Use Math::BigInt if you want to handle ints this big.
>
> $ perl -MMath::BigInt -e '
> > $foo = Math::BigInt->new("34259873425");
> > $bar = Math::BigInt->new ("1000000");
> > print $foo % $bar'
> +873425
--
Best Regards,
mds
mds resource
888.250.3987
"Dare to fix things before they break . . . "
"Our capacity for understanding is inversely proportional to how much we
think we know. The more I know, the more I know I don't know . . . "
------------------------------
Date: 30 Aug 1998 19:20:15 +0200
From: Alessandro Forghieri <alf@orion.it>
Subject: Re: Perl compiler
Message-Id: <54af4m1j5c.fsf@alpha.orion.it>
Cheers.
abigail@fnx.com (Abigail) writes:
[...]
> ++ mechanism, it does provide for more security. For example, if a hacker
> ++ can't figure out what encryption algorithm you are using, then it makes
> ++ his job harder, since he can't exploit any known weaknesses in the
> ++ algorithm.
>
>
> ``A fundamental rule of cryptography is that one must assume that the
> cryptanalyst knows the general method of encryption used. [ .. ]
[...]
> and thinking it is secret when it is not does more harm than good.''
Does this mean that publishing your security procedures
on the morning paper, sandwiched between 'High and low temperatures'
and obituaries is advisable?
I do not see any banks publishing the plans of their caveaus, or
the make/year of their safes. I wonder why.
Surely an environment that does not unnecessarily make public
details of their security measures cannot be less secure, now can it?
(Note that this would be an 'obscure' environment).
Cheers,
Alessandro
---
Alessandro Forghieri Site administrator Nouvelle srl
Email: alf@orion.it Voice: +39 59 345767
Via Giardini 460 Fax: +39 59 343822
------------------------------
Date: Sun, 30 Aug 1998 17:16:37 GMT
From: realworld6@yahoo.com
Subject: Perl Master Needed
Message-Id: <6sc1dl$o8f$1@nnrp1.dejanews.com>
Perl master needed for exciting web project. Good pay. Please email your
resume to realworld6@yahoo.com.
Living in the Colorado area is a plus.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 30 Aug 1998 20:41:09 GMT
From: pete@theory2.phys.cwru.edu
Subject: Re: perl regex bug? (or feature?)
Message-Id: <6scdd5$9m4$1@pale-rider.INS.CWRU.Edu>
In article <x7vhnb2bpo.fsf@sysarch.com>,
>>>>"URI" == Uri Guttman <uri@sysarch.com> writes:
URI>> "PJK" == Peter J Kernan <pete@theory2.phys.cwru.edu> writes:
...
URI> sounds like a different interpretation of $
URI> perlre says
URI> the "$" character [matches] at only the end
URI> (or before the newline at the end)
URI> so "be\n" would match in perl the first expression
URI> since \n was not in the last char class and $ matched
URI> the end of the string. egrep seems to
...
ok i concede the point and it is perhaps a feature. But
why dont all of the following match?
("be\n" =~ /^..$/) is true, as is ("be\n" =~ /^..\n$/) but
("be\n\n" =~ /^..\n$/) is false yet ("be\n\n" =~ /^..\n\n/) is true.
now i would think that the $ should match "before the newline at
the end" in the false expression. Given the 3 true statements,
a wild stab at the logic would lead me to deduce that the false
statement is true. But somehow it is false.
--
Pete
CWRU Physics and Statistics Depts
http://theory2.phys.cwru.edu/~pete
------------------------------
Date: Sat, 29 Aug 1998 21:56:16 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Q: remain order, hash
Message-Id: <35e86fb0.40304733@news.btinternet.com>
On Sat, 29 Aug 1998 09:30:47 GMT, dwiesel@my-dejanews.com wrote :
>Hi,
>
>I have a file with the following content
>
>---------AFile.txt----------
>29:andrea
>25:bob
>35:david
>----------------------------
>
>I wonder how I can remain the order of the persons in the file when I put them
>in a hash. I wan't to be able to go thru the hash and for each person print
>his/her name and age in the same order that were in the file.
>
Not straight out of the hash but you could put the keys into a
separate array at the same time which will retain the order.
E.G.
open(AFILE,"Afile.txt") || die "blah - $!";
while(<AFILE>)
{
chomp;
($key,$value) = split /:/ ;
$hash{$key} = $value;
push @keys, $key;
}
close AFILE;
foreach (@keys)
{
print $hash{$_},"\n";
}
Or alternatively you could use an ordered anonymous key whilst writing
the file and hold your current record as a reference to an array in
the hash in which case could do something like:
---------AFile.txt----------
1:29:andrea
2:25:bob
3:35:david
----------------------------
open(AFILE,"Afile.txt") || die "blah - $!";
while(<AFILE>)
{
chomp;
($AKey,$key,$value) = split /:/ ;
$hash{$Akey} = [$key,$value];
push @keys, $key;
}
close AFILE;
foreach (sort keys %hash)
{
print join " ", @{$hash{$_}},"\n";
}
__END__
but then you would lose any value you might get from your original
key. You also might need to re-write your datafiles - but hey thats
programming for you.
/J\
--
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 30 Aug 1998 17:36:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: WANTED: 3rd level domain script
Message-Id: <Pine.GSO.4.02A.9808301036070.14995-100000@user2.teleport.com>
On Sun, 30 Aug 1998, Michael Allen Gelman wrote:
> Could one of you PERL wizards give me a simple script to direct a 3rd
> level domain to a sub-folder?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 30 Aug 1998 13:09:31 -0700
From: Vincent Lowe <vincent@compclass.com>
Subject: Re: what's wrong with this statement?
Message-Id: <35E9B17B.4532CA3F@compclass.com>
Patrick Timmins wrote:
> In article <6s6bif$dtk$2@ligarius.ultra.net>,
> sowmaster@juicepigs.com (Bob Trieger) wrote:
> [snip]
> > If you don't stop backwhacking, you'll go blind.
>
> That's just a myth.
>
...but the part about hair on your palms is not. Ask an old sed
programmer.
---v
------------------------------
Date: Sun, 30 Aug 1998 13:29:52 -0700
From: Vincent Lowe <vincent@compclass.com>
Subject: Re: what's wrong with this statement?
Message-Id: <35E9B640.2ED4721C@compclass.com>
Vincent Lowe wrote:
>
> Patrick Timmins wrote:
>
> > In article <6s6bif$dtk$2@ligarius.ultra.net>,
> > sowmaster@juicepigs.com (Bob Trieger) wrote:
> > [snip]
> > > If you don't stop backwhacking, you'll go blind.
> >
> > That's just a myth.
> >
>
> ...but the part about hair on your palms is not. Ask an old sed
> programmer.
>
> ---v
>
...lo, and he struck the stone three times. Water gushed forth, but
he was forbidden forever to enter the promised land.
---v
--
| vincent@compclass.com | "Birds rising in flight is a sign
| CIS: 72650,2670 | that the enemy is lying in ambush..."
| 810.557.4848 | Sun Tzu
+--------------------------+-----------------------------------------
| Aqueduct Information Services http://www.compclass.com/~vincent
------------------------------
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 3591
**************************************