[30891] in Perl-Users-Digest
Perl-Users Digest, Issue: 2136 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 17 18:09:43 2009
Date: Sat, 17 Jan 2009 15:09:05 -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 Sat, 17 Jan 2009 Volume: 11 Number: 2136
Today's topics:
Checking return values (was: Re: opening a file) <tadmc@seesig.invalid>
Re: Circular lists <rvtol+usenet@xs4all.nl>
Re: Cygwin or Windows: file permission functions are br <nospam@somewhere.com>
Re: Match CASE/END SQL Construct <tadmc@seesig.invalid>
Re: Match CASE/END SQL Construct <tadmc@seesig.invalid>
Re: Match CASE/END SQL Construct <tadmc@seesig.invalid>
new CPAN modules on Sat Jan 17 2009 (Randal Schwartz)
Re: processing text larry@example.invalid
The Seven Stages of a Perl Programmer (was: Re: What do <tadmc@seesig.invalid>
Re: What do you need to have to be considered a Master <g_m@remove-comcast.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 17 Jan 2009 06:38:48 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Checking return values (was: Re: opening a file)
Message-Id: <slrngn3kao.j5s.tadmc@tadmc30.sbcglobal.net>
Tim Greer <tim@burlyhost.com> wrote:
[ recap: I wrote:
You should always, yes *always*, check the return value from open()
]
> I would personally never intentionally fail
> to check a return on a call
Just to show that my "pendulum of inflexibility" can also swing
the other way, I *never* check the return value from print().
print() has a return value to indicate success, as do many functions in Perl.
But once you have a successfully opened write filehandle, about the only
thing that can go wrong with a print() is "filesystem full".
(assuming the filehandle is connected to a real file rather than a
socket or something.)
If the filesystem is full, I won't need my little Perl program to tell
me that something is wrong, because just about everything will fail to work.
:-)
Everything in Engineering is a trade-off.
Goldilocks is the archtype engineer.
How much error checking should you do?
Not too much, not too little, just right!
Therein lies our job security.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 17 Jan 2009 18:53:16 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: Circular lists
Message-Id: <49721b0c$0$200$e4fe514c@news.xs4all.nl>
Xho Jingleheimerschmidt wrote:
> my $s = join '',@set;
Or if they are integers:
my $s = join '', map chr(), @set;
> my $two = $s . $s;
And then chop().
> next if ($two =~ /gg/);
Faster: index() >= 0;
--
Ruud
------------------------------
Date: Sat, 17 Jan 2009 11:50:18 -0500
From: "Thrill5" <nospam@somewhere.com>
Subject: Re: Cygwin or Windows: file permission functions are broken
Message-Id: <gkt28e$mjb$1@nntp.motzarella.org>
"Tim McDaniel" <tmcd@panix.com> wrote in message
news:gkqb0i$18j$1@reader1.panix.com...
> In article <gkpa8m$32j$1@nntp.motzarella.org>,
> Thrill5 <nospam@somewhere.com> wrote:
>>I'm running ActiveState 5.8.8 and my Perl doesn't act like your version.
>>C:\Documents and Settings\Administrator>perl -e "print (-w '.' ? 'yes' :
>>'no')"
>>yes
>
> &c.
>
> Thanks for the datum. I'll consider installing ActiveState, though I
> don't like the idea of two Perls.
>
You don't need two Perls, only the ActiveState one. You can still run
Cygwin programs within ActiveState Perl, but without all the headaches that
you have experienced. The ActiveState version is a port that makes Perl
behave the same way on both unix and Win32 in as much this is possible.
Cygwin only emulates a POSIX enviroment and there are bigger differences
between unix and Win32 than just POSIX.
------------------------------
Date: Sat, 17 Jan 2009 07:52:45 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Match CASE/END SQL Construct
Message-Id: <slrngn3old.j5s.tadmc@tadmc30.sbcglobal.net>
Jim Gibson <jimsgibson@gmail.com> wrote:
> In article <9GMbl.19524$Nq5.11481@newsfe24.iad>, Perry Aynum
><jc_va@hotmail.com> wrote:
>> recursively removes
>> enclosing parentheses
>> However, I want to use the same routine, but instead of looking for
>> enclosing parens, I want to look for a string enclosed by CASE and END.
> Have you tried m{ case \s* (.*?) \s* end }ix
Have you tried that with:
$_ = "fracases can erupt even among friends\n";
:-)
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 17 Jan 2009 07:45:20 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Match CASE/END SQL Construct
Message-Id: <slrngn3o7g.j5s.tadmc@tadmc30.sbcglobal.net>
sln@netherlands.com <sln@netherlands.com> wrote:
> On Thu, 15 Jan 2009 16:28:17 -0600, "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid> wrote:
>
>>Perry Aynum wrote:
>>> I have a routine that recursively removes
>>> enclosing parentheses and it works fine.
You have just not yet encountered a test case where it does not work fine...
>>> (?:\s+)?\([^\(\)]*\)
Parenthesis in character classes are not "special" and therefore
do not need to be backslashed...
>>See also: Test::Balanced and/or Parse::RecDescent
s/Test/Text/
> Why would one need a module for something so apparently simple?
Because appearances can be deceiving.
$_ = "(an opening parenthesis ('(') starts a 'memory' in a Perl regex.)\n";
print "$&\n" if /(?:\s+)?\(([^()]*)\)/;
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 17 Jan 2009 07:54:55 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Match CASE/END SQL Construct
Message-Id: <slrngn3opf.j5s.tadmc@tadmc30.sbcglobal.net>
Perry Aynum <jc_va@hotmail.com> wrote:
Are you "Perry Aynum" or are you "Buck Turgidson"?
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 17 Jan 2009 05:42:24 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Jan 17 2009
Message-Id: <KDLp6o.1Lu1@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Acme-Lingua-EN-Inflect-Modern-0.004
http://search.cpan.org/~rjbs/Acme-Lingua-EN-Inflect-Modern-0.004/
modernize Lingua::EN::Inflect rule's
----
Acme-ProgressBar-1.125
http://search.cpan.org/~rjbs/Acme-ProgressBar-1.125/
a simple progress bar for the patient
----
Amce-CNA-0.065
http://search.cpan.org/~rjbs/Amce-CNA-0.065/
a moer tolernat verison of mehtod location
----
App-Addex-0.019
http://search.cpan.org/~rjbs/App-Addex-0.019/
generate mail tool configuration from an address book
----
App-Addex-AddressBook-Abook-0.005
http://search.cpan.org/~rjbs/App-Addex-AddressBook-Abook-0.005/
use the "abook" program as the addex source
----
App-Addex-AddressBook-Apple-0.015
http://search.cpan.org/~rjbs/App-Addex-AddressBook-Apple-0.015/
use Apple Address Book as the addex source
----
App-Addex-Plugin-Hiveminder-0.004
http://search.cpan.org/~rjbs/App-Addex-Plugin-Hiveminder-0.004/
automatically add "to Hiveminder.com" addrs
----
App-Addex-Plugin-Nobody-0.003
http://search.cpan.org/~rjbs/App-Addex-Plugin-Nobody-0.003/
automatically add a recipient that goes nowhere
----
App-Cmd-0.203
http://search.cpan.org/~rjbs/App-Cmd-0.203/
write command line apps with less suffering
----
App-Cmd-Plugin-Prompt-1.001
http://search.cpan.org/~rjbs/App-Cmd-Plugin-Prompt-1.001/
plug prompting routines into your commands
----
App-Nopaste-0.07
http://search.cpan.org/~sartak/App-Nopaste-0.07/
easy access to any pastebin
----
App-Smarkmail-0.003
http://search.cpan.org/~rjbs/App-Smarkmail-0.003/
pipemailer that changes plaintext to multi/alt with Markdown
----
App-Whiff-0.002
http://search.cpan.org/~rjbs/App-Whiff-0.002/
find the first executable of a series of alternatives
----
Audio-Extract-PCM-0.04
http://search.cpan.org/~pepe/Audio-Extract-PCM-0.04/
Extract PCM data from audio files
----
BerkeleyDB-Manager-0.12
http://search.cpan.org/~nuffin/BerkeleyDB-Manager-0.12/
General purpose BerkeleyDB wrapper
----
BioPerl-1.5.9_3
http://search.cpan.org/~cjfields/BioPerl-1.5.9_3/
Loader for LiveSeq from EMBL entries with BioPerl
----
Bryar-Config-YAML-0.103
http://search.cpan.org/~rjbs/Bryar-Config-YAML-0.103/
Bryar configuration stored in YAML
----
Bryar-DataSource-Multiplex-0.122
http://search.cpan.org/~rjbs/Bryar-DataSource-Multiplex-0.122/
multiplex Bryar datasources
----
Builder-0.04
http://search.cpan.org/~draegtun/Builder-0.04/
Build XML, HTML, CSS and other outputs in blocks
----
Bundle-Email-0.044
http://search.cpan.org/~rjbs/Bundle-Email-0.044/
(DEPRECATED) you want Task::Email::PEP::NoStore
----
CGI-Application-Plugin-YAML-0.01
http://search.cpan.org/~cosmicnet/CGI-Application-Plugin-YAML-0.01/
YAML methods CGI::App
----
CPAN-Mini-0.576
http://search.cpan.org/~rjbs/CPAN-Mini-0.576/
create a minimal mirror of CPAN
----
Config-INI-0.014
http://search.cpan.org/~rjbs/Config-INI-0.014/
simple .ini-file format
----
Config-INI-MVP-0.019
http://search.cpan.org/~rjbs/Config-INI-MVP-0.019/
----
Continuation-Escape-0.02
http://search.cpan.org/~sartak/Continuation-Escape-0.02/
escape continuations (returning higher up the stack)
----
DBD-ODBC-1.18
http://search.cpan.org/~mjevans/DBD-ODBC-1.18/
ODBC Driver for DBI
----
DBD-WMI-0.06
http://search.cpan.org/~corion/DBD-WMI-0.06/
interface to the Windows WMI
----
DBD-drizzle-0.003
http://search.cpan.org/~capttofu/DBD-drizzle-0.003/
MySQL driver for the Perl5 Database Interface (DBI)
----
Data-GUID-0.045
http://search.cpan.org/~rjbs/Data-GUID-0.045/
globally unique identifiers
----
Data-GUID-URLSafe-0.004
http://search.cpan.org/~rjbs/Data-GUID-URLSafe-0.004/
url-safe base64-encoded GUIDs
----
Data-OptList-0.104
http://search.cpan.org/~rjbs/Data-OptList-0.104/
parse and validate simple name/value option pairs
----
Dotiac-0.2
http://search.cpan.org/~maluku/Dotiac-0.2/
----
EAFDSS-0.13
http://search.cpan.org/~hasiotis/EAFDSS-0.13/
Electronic Fiscal Signature Devices Library
----
Email-Valid-0.180
http://search.cpan.org/~rjbs/Email-Valid-0.180/
Check validity of Internet email addresses
----
Geo-Coder-Google-0.04
http://search.cpan.org/~miyagawa/Geo-Coder-Google-0.04/
Google Maps Geocoding API
----
Graph-0.91
http://search.cpan.org/~jhi/Graph-0.91/
graph data structures and algorithms
----
HTML-FormHandler-0.04
http://search.cpan.org/~gshank/HTML-FormHandler-0.04/
form handler written in Moose
----
IO-Lambda-1.04
http://search.cpan.org/~karasik/IO-Lambda-1.04/
non-blocking I/O as lambda calculus
----
Lingua-Identify-0.22
http://search.cpan.org/~ambs/Lingua-Identify-0.22/
Language identification
----
Lingua-Identify-0.23
http://search.cpan.org/~ambs/Lingua-Identify-0.23/
Language identification
----
Log-Dispatchouli-1.003
http://search.cpan.org/~rjbs/Log-Dispatchouli-1.003/
a simple wrapper around Log::Dispatch
----
MIME-Lite-3.024
http://search.cpan.org/~rjbs/MIME-Lite-3.024/
low-calorie MIME generator
----
Mail-DeliveryStatus-BounceParser-1.520
http://search.cpan.org/~rjbs/Mail-DeliveryStatus-BounceParser-1.520/
Perl extension to analyze bounce messages
----
Module-Starter-Plugin-CGIApp-0.10
http://search.cpan.org/~jaldhar/Module-Starter-Plugin-CGIApp-0.10/
template based module starter for CGI apps.
----
MooseX-WithCache-0.00002
http://search.cpan.org/~dmaki/MooseX-WithCache-0.00002/
Easy Cache Access From Moose Objects
----
Nagios-Object-0.21
http://search.cpan.org/~duncs/Nagios-Object-0.21/
----
Net-LDAP-Class-0.17
http://search.cpan.org/~karman/Net-LDAP-Class-0.17/
object-relational mapper for Net::LDAP
----
Net-SMS-ASPSMS-0.1.2
http://search.cpan.org/~supcik/Net-SMS-ASPSMS-0.1.2/
Interface to ASMSMS services
----
Net-Twitter-2.00
http://search.cpan.org/~cthom/Net-Twitter-2.00/
Perl interface to twitter.com
----
Net-Twitter-2.01
http://search.cpan.org/~cthom/Net-Twitter-2.01/
Perl interface to twitter.com
----
NetAddr-IP-4.023
http://search.cpan.org/~miker/NetAddr-IP-4.023/
Manages IPv4 and IPv6 addresses and subnets
----
Parse-Marpa-1.001_004
http://search.cpan.org/~jkegl/Parse-Marpa-1.001_004/
Generate Parsers from any BNF grammar
----
REST-Google-1.0.5
http://search.cpan.org/~ejs/REST-Google-1.0.5/
access Google REST (aka AJAX) API from Perl
----
RestClient-56
http://search.cpan.org/~mcrawfor/RestClient-56/
----
RestClient-60
http://search.cpan.org/~mcrawfor/RestClient-60/
----
Scope-Upper-0.06
http://search.cpan.org/~vpit/Scope-Upper-0.06/
Act on upper scopes.
----
Simo-0.03_06
http://search.cpan.org/~kimoto/Simo-0.03_06/
Very simple framework for Object Oriented Perl.
----
Software-License-0.009
http://search.cpan.org/~rjbs/Software-License-0.009/
packages that provide templated software licenses
----
Sub-Exporter-0.982
http://search.cpan.org/~rjbs/Sub-Exporter-0.982/
a sophisticated exporter for custom-built routines
----
Sub-Install-0.925
http://search.cpan.org/~rjbs/Sub-Install-0.925/
install subroutines into packages easily
----
Task-BeLike-RJBS-1.003
http://search.cpan.org/~rjbs/Task-BeLike-RJBS-1.003/
be more like RJBS -- use the modules he likes!
----
Text-JaroWinkler-0.1
http://search.cpan.org/~scw/Text-JaroWinkler-0.1/
An implementation of the Jaro-Winkler distance
----
URI-Escape-XS-0.03
http://search.cpan.org/~dankogai/URI-Escape-XS-0.03/
Drop-In replacement for URI::Escape
----
URI-Escape-XS-0.04
http://search.cpan.org/~dankogai/URI-Escape-XS-0.04/
Drop-In replacement for URI::Escape
----
WWW-MeGa-0.1.1
http://search.cpan.org/~fish/WWW-MeGa-0.1.1/
A MediaGallery
----
WWW-MeGa-0.11
http://search.cpan.org/~fish/WWW-MeGa-0.11/
A MediaGallery
----
resched-0.7.3
http://search.cpan.org/~jonadab/resched-0.7.3/
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Fri, 16 Jan 2009 23:07:55 -0700
From: larry@example.invalid
Subject: Re: processing text
Message-Id: <14nlqgmvfpj2k.r2jo0gpammgd$.dlg@40tude.net>
On Thu, 15 Jan 2009 17:44:29 -0800, Tim Greer wrote:
> George wrote:
>
>> My days
>> as george are numbered (thank goodness).
>
> Thank God! The 20th is my birthday and I couldn't think of a better
> present (I'm not being sarcastic).
Thanks for your attention, Tim.
I have a much more difficult text processing project, furthermore, I am
switching nyms from the least curious george I ever witnessed. The only
gesture he left out of his last address was throwing out a nice piece of
poop for us all to share.
My identity will be Larry Gates, and my e-mail will be
larry@example.invalid . If you're inclined to have me in your killfile,
*please* update this tradition.
I'll start a new thread with the name I wrote on the wall.
--
George
It's hard to tune heavily tuned code. :-)
-- Larry Wall in <199801141725.JAA07555@wall.org>
------------------------------
Date: Sat, 17 Jan 2009 07:27:15 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: The Seven Stages of a Perl Programmer (was: Re: What do you need to have to be considered a Master at Perl?)
Message-Id: <slrngn3n5j.j5s.tadmc@tadmc30.sbcglobal.net>
sln@netherlands.com <sln@netherlands.com> wrote:
> Subject: What do you need to have to be considered a Master at Perl?
For me, they must first get past these prerequisites about the
two "weird things" that are in Perl, but not in any other
programming language (AFAIK):
context (scalar vs. list)
two completely separate systems of variables (package vs. lexical)
If they get past those, then proceed to the ones below. :-)
I can't find Tom Christiansen's original, so I'll go with Nat's
reconstruction of:
The Seven Stages of a Perl Programmer
(From http://prometheus.frii.com/~gnat/yapc/2000-stages/)
Novice:
* Thinks CGI and Perl are interchangeable terms.
* Still thinks Perl looks like bad C code viewed over a noisy modem.
* Is insecure about the concept of dollar signs and at signs.
* Thinks Perl should be more like sh or tcl.
* Has heard of the ``Unix mindset'', but hopes it's a treatable condition.
* Can't figure out how to read input from the keyboard.
* Thinks regular expressions are somebody cursing.
* Wonders why no one can give him a straight answer about whether
Perl is compiled or interpreted.
Initiate:
* Has begun to learn about $_* and doesn't like it one bit.
* Thinks the -w flag is a waste of time.
* Thinks Perl should be more like C++ or Java.
* Is still trying to figure why Perl has two different kinds of arrays.
* Knows how to use perlbug, but sends in bogus bug reports.
* Has been bitten by implicit context conversions, but hasn't caught
on yet to how it was triggered.
* Can't keep == separate from eq, and still thinks that + should
concatenate strings.
User:
* Thinks Perl is just for text processing.
* Uses the Perl debugger.
* Has used other people's modules.
* Wonders what an object is.
* Knows their way around CPAN.
* Knows the difference between local and my.
* Uses <DATA>.
* Is still trying to figure what references are for.
* Thinks Perl should be more like scheme or eiffel.
* Submits real bug reports with perlbug.
Adept:
* Write JAPHs to impress their friends and annoy their coworkers.
* Begins all programs with use strict.
* Thinks Perl should just be Perl.
* Has taken enough advantage of cryptocontext to annoy others.
* Knows how to create records and objects with hash refs.
* Uses syscall to get at undocumented operating system calls.
* Curses the flexibility of the Perl object system.
* Uses /e in substitutes.
* Has begun to wonder what typeglobs are for.
* Has written their own modules in Perl.
* Begins to look at all data in terms of regular expressions.
* Understands why regexes can't match nested data.
* Rewrites minor utilities in Perl.
Hacker:
* Writes games in Perl.
* Has written extension modules in C.
* Uses AUTOLOAD and closures in curious ways.
* Appreciates the aethetics of the Schwartzian Transform.
* Delights in the flexibility of the Perl object system.
* Has written their own pod2XXX translator.
* Understands the output from Perl -D flags.
* Accesses the Perl symbol table directly.
* Submits bug reports with working patches.
* Edits files using a special Perl-embedded version of vi or emacs.
* Has contributed modules, manpages, and tools to the standard
Perl distribution.
Guru:
* Can answer any Perl question instantly.
* Can write anything in Perl, and does.
* Takes advantage of undocumented language features.
* Writes code that gives even Larry pause.
* Implements opaque objects and compiled regexes using closures.
* Can read and understand the output of the perl-to-C compiler.
* Embeds Perl interpreters in larger applications.
* Has written their own -d:debugger module.
* Used object-oriented programming before it existed.
* Is debating taking their turn with the patch pumpkin.
Wizard:
* Is on a first-name basis with Larry's wife.
* Has written or rewritten major subsystems of the Perl compiler or interpreter.
* Is thinking about rewriting the regex engine, the memory allocator,
or the garbage collector.
* Doesn't write games in Perl because they realize that Perl is the game.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 17 Jan 2009 17:29:38 -0500
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: What do you need to have to be considered a Master at Perl?
Message-Id: <Zo2dnQ4xtqrsxu_UnZ2dnUVZ_tTinZ2d@giganews.com>
Jürgen Exner > ...
> Sherm Pendley > ..
>>...
>>Someone who understands the Chomsky hierarchy,
>> and why not every context-free language can be
>> described with a regular grammar.
>
> :-))
>
> YMMD
~~~~~~~~~~~~~~~~~~~~~~~~~
I looked it up:
Acronym Definition
YMMD You Made My Day
or
YMMD Your Mileage May Differ
~~~~~~
I took a course in recursive function theory many many years ago
(grad-level, math dept) --- which I have completely forgotten,
except that I am quite certain that perl was never mentioned in it.
I don't think perl actually existed back then. So I wasn't disappointed
about that. But I did happen to have read Chomsky's "Syntactic Structures",
in which he talked about 'transformational grammar",and
"deep vs surface structure" (--which was his contribution,
-the hierarchy stuff coming from a different, math-logic tradition.)
At the time I thought that was really fascinating stuff.
But none of it was in course either. And I was
disappointed about that.
~~
As I said before, in this thread, I have recently learned
how to match balanced parentheses.
But that was a botched joke, because what I meant to say was that
"I've learnt how to match balanced parentheses with regular expressions."
However, whether "recursive regular expressions" is an oxymoron,
or whether perl forces us to expand the definition of "regular expression",
isn't the sort of terminological question that could ever bother me.
I've seen maybe dozens, maybe hundreds, of utterly astonishingly
different embodiments of the hierarchy. And the great beauty of the
subject is seeing what they have in common, in terms of what
can and can't be accomplished at the different abstract levels.
The beauty of the subject is very similar to Galois theory.
One practical spin-off of which is that no rational person
will ever try to "square the circle with ruler and compass alone."
Likewise, I am definitely not an expert. But I do feel, for example,
that I have an effectively computed elementary intuition that balanced
parentheses simply can not be parsed by any kind of machine
unless it has some kind of equivalent of an unlimited memory
or push down stack. No matter how deeply it's hidden, it has
to be there somewhere.
The perlre section on (??{code}) warns that
Recursing deeper than 50 times without consuming
any input string will result in a fatal error. The maximum
depth is compiled into perl, so changing it requires a
custom build.
And I don't really understand that.
But my intuition tells me that it means that the perl regex engine
is still a true "regular expression" engine.
That is, it does not have an infinite push down stack.
So the tricks with (??{code}) or (?PARNO) can only give
the illusion of being able to parse balanced constructs.
I wouldn't needs to know how they work to know that.
If the warning had said "recursing deeper than 50 times...will result in a fatal error"
then I would have felt I understood it. What I do not understand
is how "consuming ... input string" could change the situation.
I am sure that I ran across that section in perlre about (??{ code })
a long time ago, but immediately forgot about it because of the dire
WARNING: This extended regular expression feature is considered experimental
and may be changed without notice..."
etc.
And now 5.10 has the (?PARNO) feature that is said to be
a "more efficient way to accomplish the same task".
But it too has warnings.
Now, I don't care if perl regular expressions are or aren't kosher.
It's those warnings that bother me.
And I was hoping that a perl-expert would "talk me down"
about being too afraid to use them.
~greg
------------------------------
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 V11 Issue 2136
***************************************