[25343] in Perl-Users-Digest
Perl-Users Digest, Issue: 7588 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 28 21:05:44 2004
Date: Tue, 28 Dec 2004 18:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 28 Dec 2004 Volume: 10 Number: 7588
Today's topics:
Re: getting array elements <nospam@nospam.com>
Re: handle multiple submit button. <eighner@io.com>
Re: handle multiple submit button. <matthew.garrish@sympatico.ca>
Re: handle multiple submit button. <matthew.garrish@sympatico.ca>
Re: help: negative lookahead and backref in regex? (Anno Siegel)
Re: help: negative lookahead and backref in regex? <noreply@gunnar.cc>
Re: help: negative lookahead and backref in regex? <stenor@bayarea.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 28 Dec 2004 18:34:58 -0500
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: getting array elements
Message-Id: <1104276874.394728@nntp.acecape.com>
"Chris Mattern" <matternc@comcast.net> wrote in message
news:z6GdncN3PK36fkzcRVn-sQ@comcast.com...
> daniel kaplan wrote:
>
>
> For someone who's not even going to bother, you surely seem
> determined to have the last world.
the world? absolutely, i do want the world. as for the last word, more of
just an auto-response.
please note, not poking fun of your typing....my typing skill's, or lack
thereof, were legendary here within days....just trying to lighten the mood
;-)
daniel
------------------------------
Date: Tue, 28 Dec 2004 17:32:54 -0600
From: Lars Eighner <eighner@io.com>
Subject: Re: handle multiple submit button.
Message-Id: <slrnct3r3u.21t6.eighner@goodwill.io.com>
In our last episode,
<1104263134.939281.93240@z14g2000cwz.googlegroups.com>,
the lovely and talented ioneabu@yahoo.com
broadcast on comp.lang.perl.misc:
> Lars Eighner wrote:
> ...
>> Third perl is not CGI.
> Just look at the Larry Wall home page to see that this is true. On the
> other hand, I have found CGI programming via CGI.pm is the best user
> interface to Perl programs.
As it happens, I was working on the README for my small
databases manager (to use a number of databases similar to and
including various old DOS-type databases, spreadsheets, and
various "office suite" type applications -- no, it is not nearly
done, but I tend to document as I go because I am too senile to
remember what I did yesterday if I haven't documented) and I was
trying to explain (in the README) why a cgi interface for a
program that is *not* intended for a public server on the
world-wide web.
You see, there just is no trick to programming. It is easy.
And anyone with a computer should give it a try. The trick -
what the professionals get paid for - is making programs run on
many different computers, with many different OSs, i/o devices,
etc. That stuff is really, really hard - and there are dozens,
even hundreds, of vendors out there trying all the time to
produce new hardware to break your application.
But html forms have a fairly complete toolkit for data input,
html has an adequate way of marking up output, and most browsers
do a pretty good job of presenting html documents - particularly
if you give them a chance to do their jobs instead of trying to
throttle them into absolute presentational subservience (and if
you trust users to configure their browsers in a way that is
most comfortable for them).
CGI takes care of the nasty stuff so even an idiot can write
programs that do useful things. There ought to be a word for
not-necessarily-for-the-web cgi programming.
Here's a hint, even if you have a local server, lynx - compiled
and configured for lynxcgi if it is available for your platform
- is a really helpful tool for working on these kinds of
applications.
I'd be happy to know of other browsers that have some scheme for
running cgi without a server (not that it is brain surgery - the
browser just has to provide a - usually - minimal environment,
launch the script, and catch and render the output). I run a
server locally, and at some point I move applications to it for
testing. But at the still-sort-of-vague-on-things level,
browser cgi is great. And for personal-type applications,
browser cgi might be the best solution.
> It is very simple, even easier than actually fully
> understanding HTML and CGI programming without CGI.pm, and it
> is as portable as you can get. No virtual machine to install,
> just an up-to-date browser on just about any current OS
> (assuming you have access to one of the many low cost web
> hosters). A google search for 'CGI.pm home page' brings up
> the official home page with everything you need to know about
> CGI.pm. I bought the books anyway because I felt that Dr.
> Lincoln Stein is a great man and deserves all the book sales
> he can get. I wonder why he doesn't publish with O'Reilly. I
> don't know much about the inner-circle of Perl, but his CGI.pm
> work is discussed in every O'Reilly Perl book that I have
> read, so why is he with a different publisher?
> Anyway, if you want to really have fun programming, immerse yourself in
> CGI programming with Perl. I can't get enough of it.
--
Lars Eighner eighner@io.com http://www.io.com/~eighner/
War On Terrorism: Joe McCarthy Brigade
"The decadent left in its enclaves on the coasts is not dead -- and may well
mount a fifth column." Andrew Sullivan, _The New Republic_
------------------------------
Date: Tue, 28 Dec 2004 20:19:42 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: handle multiple submit button.
Message-Id: <LCnAd.21418$nV.652604@news20.bellglobal.com>
"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:sgl2t0tulace9agdtu663dk62jan9blc16@4ax.com...
> On Tue, 28 Dec 2004 11:33:56 +0100, Gunnar Hjalmarsson
> <noreply@gunnar.cc> wrote:
>
>>> My pervious post
>>
>>Which previous post?
>
> Pay attention: he never said "previous post"...
> ;-)
>
>
And unlike some newbies, he admits he's open to new ideas. I prefer pervious
posters to impervious ones...
Matt
------------------------------
Date: Tue, 28 Dec 2004 20:28:53 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: handle multiple submit button.
Message-Id: <mLnAd.21512$nV.654625@news20.bellglobal.com>
"Abigail" <abigail@abigail.nl> wrote in message
news:slrnct3gr5.non.abigail@alexandra.abigail.nl...
> ioneabu@yahoo.com (ioneabu@yahoo.com) wrote on MMMMCXXXVII September
> MCMXCIII in
> <URL:news:1104263134.939281.93240@z14g2000cwz.googlegroups.com>:
> ''
> '' Lars Eighner wrote:
> '' ...
> '' > Third perl is not CGI.
> ''
> '' Just look at the Larry Wall home page to see that this is true. On
> the
> '' other hand, I have found CGI programming via CGI.pm is the best user
> '' interface to Perl programs. It is very simple, even easier than
> '' actually fully understanding HTML and CGI programming without CGI.pm,
> '' and it is as portable as you can get. No virtual machine to install,
> '' just an up-to-date browser on just about any current OS (assuming you
> '' have access to one of the many low cost web hosters). A google search
> '' for 'CGI.pm home page' brings up the official home page with
> everything
> '' you need to know about CGI.pm. I bought the books anyway because I
> '' felt that Dr. Lincoln Stein is a great man and deserves all the book
> '' sales he can get. I wonder why he doesn't publish with O'Reilly. I
> '' don't know much about the inner-circle of Perl, but his CGI.pm work is
> '' discussed in every O'Reilly Perl book that I have read, so why is he
> '' with a different publisher?
>
> + Perhaps because not everyone is convinced O'Reilly is the best publisher
> under the sun?
>
And judging a book by its publisher is such a bad idea. I'd rather get a
Conway book on Perl published by Manning or a Stein book by Addison-Wesley
than an O'Reilly book by some unknown...
Matt
------------------------------
Date: 29 Dec 2004 00:13:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: help: negative lookahead and backref in regex?
Message-Id: <cqsss5$2f9$1@mamenchi.zrz.TU-Berlin.DE>
<stenor@bayarea.net> wrote in comp.lang.perl.misc:
> I'd appreciate some help from a regex guru with this:
>
> I'm trying to match a pattern that looks more or less like this:
>
> <string1><statictext><string2>
>
> where string1 and string2 are not the same. I need to do this in a
> single regex (rather than capturing $1 and $2 and comparing after the
> fact.
>
> I've tried this as a test (in this case <statictext> is just
> whitespace:
>
> /(\w+)\s+(?!\1)/
>
> This will match "foo bar" as expected, but it also matches "foo foo"
> which it ought not to.
It matches "oo", followed by a blank, followed by something that is not
"oo" (namely "foo"), as it ought to. You may want to anchor the pattern,
or use "\b" boundaries around parts.
Anno
------------------------------
Date: Wed, 29 Dec 2004 00:59:49 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: help: negative lookahead and backref in regex?
Message-Id: <41D1F375.3010203@gunnar.cc>
stenor@bayarea.net wrote:
> I'm trying to match a pattern that looks more or less like this:
>
> <string1><statictext><string2>
>
> where string1 and string2 are not the same. I need to do this in a
> single regex (rather than capturing $1 and $2 and comparing after the
> fact.
>
> I've tried this as a test (in this case <statictext> is just
> whitespace:
>
> /(\w+)\s+(?!\1)/
>
> This will match "foo bar" as expected, but it also matches "foo foo"
> which it ought not to.
No, it doesn't. It matches "oo foo", which it ought to. ;-) Did you try
to print the $1 variable?
<snip>
> Any ideas regarding why using the negative lookahead assertion as I've
> done doesn't do what I'd like it to do? And/or how to do it correctly?
Express yourself more clearly, by for instance adding a word boundary
character. This matches "foo bar" but not "foo foo":
/\b(\w+)\s+(?!\1)/
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 28 Dec 2004 17:20:19 -0800
From: Scott Panzer <stenor@bayarea.net>
Subject: Re: help: negative lookahead and backref in regex?
Message-Id: <Pine.NEB.4.58.0412281716250.4215@baygate.bayarea.net>
Thanks Gunnar, this is very helpful.
On Wed, 29 Dec 2004, Gunnar Hjalmarsson wrote:
> stenor@bayarea.net wrote:
> > I'm trying to match a pattern that looks more or less like this:
> >
> > <string1><statictext><string2>
> >
> > where string1 and string2 are not the same. I need to do this in a
> > single regex (rather than capturing $1 and $2 and comparing after the
> > fact.
> >
> > I've tried this as a test (in this case <statictext> is just
> > whitespace:
> >
> > /(\w+)\s+(?!\1)/
> >
> > This will match "foo bar" as expected, but it also matches "foo foo"
> > which it ought not to.
>
> No, it doesn't. It matches "oo foo", which it ought to. ;-) Did you try
> to print the $1 variable?
>
> <snip>
>
> > Any ideas regarding why using the negative lookahead assertion as I've
> > done doesn't do what I'd like it to do? And/or how to do it correctly?
>
> Express yourself more clearly, by for instance adding a word boundary
> character. This matches "foo bar" but not "foo foo":
>
> /\b(\w+)\s+(?!\1)/
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
>
--------------------------------------------------------------------
Scott Panzer http://www.bayarea.net/~stenor Sunnyvale, CA
PGP public keys found available at my web site
--------------------------------------------------------------------
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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.
#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 V10 Issue 7588
***************************************