[31124] in Perl-Users-Digest
Perl-Users Digest, Issue: 2369 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 26 21:09:43 2009
Date: Sun, 26 Apr 2009 18:09:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 26 Apr 2009 Volume: 11 Number: 2369
Today's topics:
Can't use Perl RE (s///) within (?{}) <clint.olsen@gmail.com>
Re: Can't use Perl RE (s///) within (?{}) sln@netherlands.com
Re: Perl is too slow - A statement <n@solenttechnology.co.uk>
Re: Perl is too slow - A statement <cwilbur@chromatico.net>
Re: Perl is too slow - A statement sln@netherlands.com
Re: Perl is too slow - A statement <tadmc@seesig.invalid>
Re: Perl is too slow - A statement <liarafan@xs4all.nl>
Re: pod2ipf in Perl 5.10? <pauldespam@despamsmedley.id.au>
Re: Posting to perl.beginners via google groups <whynot@pozharski.name>
Tk::Listbox greymausg@mail.com
Re: Tk::Listbox sln@netherlands.com
Re: Tk::Listbox greymausg@mail.com
Re: Tk::Listbox greymausg@mail.com
Re: unexplained warning message in m{...} regexp sln@netherlands.com
Re: unexplained warning message in m{...} regexp <nospam-abuse@ilyaz.org>
Re: unexplained warning message in m{...} regexp <nospam-abuse@ilyaz.org>
Re: unexplained warning message in m{...} regexp sln@netherlands.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 26 Apr 2009 14:11:54 -0700 (PDT)
From: Clint O <clint.olsen@gmail.com>
Subject: Can't use Perl RE (s///) within (?{})
Message-Id: <807f67ae-27d9-424e-8b8c-63a078341f6b@i28g2000prd.googlegroups.com>
Hi:
Unfortunately, the program I have is way too complex to post here, but
I wrote a lexical analyzer in Perl which makes heavy use of these code
blocks because it more closely approximates the behavior of lex/flex
than anything else I've found. I've tried both 5.8.7 and 5.10.0 with
varying results, and I've noticed that when I attempt to call the
regular expression engine inside I get two possible outcomes:
1) Out of memory
2) Segmentation fault
my $macro_text = qr/^(.*?[^\\]\n)
(?{
$text = $^N;
#$text_lines = $text =~ s|\\\n|\n|
gs;
@text_lines = split('\n', $text);
@r = ('MACRO_TEXT', $text, scalar
(@text_lines), 0);
})
/sx;
The following attempts to snarf arbitrary replacement text in a
textual macro up to a newline not preceded by a backslash. One of the
things I need to do is a few transformations according the user guide
like strip the backslashes out of the macro text. There are a few
others.
I've also noticed that declaring 'my' variables local to these blocks
can cause Perl segfaults etc. as well. I do realize these code blocks
are experimental, but this simplifies my life quite a bit by allowing
the inline code to make pattern specific calculations before the match
is complete.
Any suggestions you could offer would be much appreciated.
Thanks,
-Clint
------------------------------
Date: Sun, 26 Apr 2009 18:03:10 -0700
From: sln@netherlands.com
Subject: Re: Can't use Perl RE (s///) within (?{})
Message-Id: <22t9v4563brd67u4ans07s11s28ckht8mg@4ax.com>
On Sun, 26 Apr 2009 14:11:54 -0700 (PDT), Clint O <clint.olsen@gmail.com> wrote:
>Hi:
>
>Unfortunately, the program I have is way too complex to post here, but
>I wrote a lexical analyzer in Perl which makes heavy use of these code
>blocks because it more closely approximates the behavior of lex/flex
>than anything else I've found. I've tried both 5.8.7 and 5.10.0 with
>varying results, and I've noticed that when I attempt to call the
>regular expression engine inside I get two possible outcomes:
>
>1) Out of memory
>2) Segmentation fault
>
>my $macro_text = qr/^(.*?[^\\]\n)
> (?{
> $text = $^N;
>
> #$text_lines = $text =~ s|\\\n|\n|
>gs;
> @text_lines = split('\n', $text);
>
> @r = ('MACRO_TEXT', $text, scalar
>(@text_lines), 0);
> })
> /sx;
>
>The following attempts to snarf arbitrary replacement text in a
>textual macro up to a newline not preceded by a backslash. One of the
>things I need to do is a few transformations according the user guide
>like strip the backslashes out of the macro text. There are a few
>others.
>
>I've also noticed that declaring 'my' variables local to these blocks
>can cause Perl segfaults etc. as well. I do realize these code blocks
>are experimental, but this simplifies my life quite a bit by allowing
>the inline code to make pattern specific calculations before the match
>is complete.
>
>Any suggestions you could offer would be much appreciated.
>
>Thanks,
>
>-Clint
I don't think a regex in the code block is going to fly
even if doing the regex from a called sub. I think its more a problem
on the substitution side of s/// that is the problem. Some (re-eval 1) error.
sub strip_stuff {
my $text = shift;
$text =~ s/\\\n/\n/g;
return $text;
}
qr /...
(? {
$text = $^N;
#$text_lines = $text =~ s|\\\n|\n|gs;
$text = strip_stuff ($text);
...
})
/xs
Within the code block things are very quirky and limited.
For all but the simplest things, this is still part of the regular expression.
So inside a regular expression it would seem doubtfull you can have another regular
expression. Even the delemiters have to be different just to parse. Have you tried $text /= 5; ?
In my test, in the code block, my() crashed and any regular expression crashes thats for sure.
------------------------------
Date: Sun, 26 Apr 2009 01:21:30 -0700 (PDT)
From: neilsolent <n@solenttechnology.co.uk>
Subject: Re: Perl is too slow - A statement
Message-Id: <fdb30428-1559-4715-b799-12f9067dc46c@b7g2000pre.googlegroups.com>
> We hear this all too common:
> =A0 =A0 =A0 =A0 =A0 =A0 "I have one huge problem with Perl; it is too slo=
w."
>
> But is Perl realy slow, could perl be slow at all?
In my experience Perl is fast, in fact breath-takingly fast for an
interpreted language, and given the huge high-level functionality it
provides.
I don't have any benchmarks to back this up, but I think it is a known
fact that it compares reasonably to even optimised C code, performing
similar tasks. Obviously it really depends what tasks we are talking
about.
Why don't you post some simple scripts doing what you think Perl is
slow at - and show us how it can be done faster in some other language?
------------------------------
Date: Sun, 26 Apr 2009 14:21:47 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Perl is too slow - A statement
Message-Id: <868wlnl1hg.fsf@mithril.chromatico.net>
>>>>> "m" == mercurish <mercurish@googlemail.com> writes:
m> But is Perl ready to be used for huge projects or is other
m> languges such as Python taking over??
You might have asked this question a decade and a half ago, and gotten
an interesting debate. As it is, Perl is not only ready to be used for
huge projects, but is actually currently being used for large projects.
m> What are we going to do??
We are going to continue working on our codebases of hundreds of
thousands of lines of Perl. What are *you* going to do?
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Sun, 26 Apr 2009 12:28:09 -0700
From: sln@netherlands.com
Subject: Re: Perl is too slow - A statement
Message-Id: <lcd9v4pmovibppki1qnht1ftrn9lm8po7m@4ax.com>
On Sun, 26 Apr 2009 01:21:30 -0700 (PDT), neilsolent <n@solenttechnology.co.uk> wrote:
>> We hear this all too common:
>> "I have one huge problem with Perl; it is too slow."
>>
>> But is Perl realy slow, could perl be slow at all?
>
>In my experience Perl is fast, in fact breath-takingly fast for an
>interpreted language, and given the huge high-level functionality it
>provides.
>I don't have any benchmarks to back this up, but I think it is a known
>fact that it compares reasonably to even optimised C code, performing
>similar tasks. Obviously it really depends what tasks we are talking
>about.
>Why don't you post some simple scripts doing what you think Perl is
>slow at - and show us how it can be done faster in some other language?
char *str = "This is a long sentence";
printf ("%s", &str[10]);
----------------
my $str = "This is a long sentence";
my @words = split ' ', $str;
printf ("%s %s", @words[3,4]);
-sln
------------------------------
Date: Sun, 26 Apr 2009 16:33:02 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Perl is too slow - A statement
Message-Id: <slrngv9koe.8av.tadmc@tadmc30.sbcglobal.net>
sln@netherlands.com <sln@netherlands.com> wrote:
> On Sun, 26 Apr 2009 01:21:30 -0700 (PDT), neilsolent <n@solenttechnology.co.uk> wrote:
>
>>> We hear this all too common:
>>> "I have one huge problem with Perl; it is too slow."
>>>
>>> But is Perl realy slow, could perl be slow at all?
>>
>>In my experience Perl is fast, in fact breath-takingly fast for an
>>interpreted language, and given the huge high-level functionality it
>>provides.
>>I don't have any benchmarks to back this up, but I think it is a known
>>fact that it compares reasonably to even optimised C code, performing
>>similar tasks. Obviously it really depends what tasks we are talking
>>about.
>>Why don't you post some simple scripts doing what you think Perl is
>>slow at - and show us how it can be done faster in some other language?
>
> char *str = "This is a long sentence";
> printf ("%s", &str[10]);
>
> ----------------
>
> my $str = "This is a long sentence";
print substr($str, 10);
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 27 Apr 2009 00:16:37 +0200
From: "Mark" <liarafan@xs4all.nl>
Subject: Re: Perl is too slow - A statement
Message-Id: <6sudnQ6ddZ7ZQGnUnZ2dnUVZ8jCdnZ2d@giganews.com>
"Uri Guttman" <uri@stemsystems.com> wrote in message
news:87hc0dzg54.fsf@quad.sysarch.com...
>>>>>> "m" == mercurish <mercurish@googlemail.com> writes:
>
> m> What are we going to do??
>
> *'WE'* are going to ignore trolls like you who don't know from slow vs
> fast. you can create slow programs in any language. i can write perl
> that runs faster than most people can in their favorite language. you
> question is useless.
The whole topic looks a bit trollish, indeed. There ARE instances, though,
where Perl buckles, like:
http://swtch.com/~rsc/regexp/regexp1.html
I doubt this has ever been a real-life problem to anyone, though.
- Mark
------------------------------
Date: 26 Apr 2009 22:07:54 GMT
From: "Paul Smedley" <pauldespam@despamsmedley.id.au>
Subject: Re: pod2ipf in Perl 5.10?
Message-Id: <POn1Xm9ddZOp-pn2-HGd75dgbvE56@smedley.info>
Hi,
On Sun, 26 Apr 2009 12:34:43 UTC, Shmuel (Seymour J.) Metz
<spamtrap@library.lspace.org.invalid> wrote:
> I'll try retrieving the latest pod2ipf from CPAN and see whether that
> helps. I had assumed that pod2ipf was a pretty basic package for an OS/2
> build; maybe Snedley will include if for the 5.10.1 build, assuming that
> he does one. The only other things that I currently need beyond core Perl
> are net::DNS and regexp::Common::URI, which I'll take care of once I
> figure out how to configure gcc.
I don't see a 5.10.1 - perl.org shows 5.10.0 as the current version.
I don't plan on installing any external packages as part of the
distro....
--
Cheers,
Paul.
------------------------------
Date: Sun, 26 Apr 2009 17:44:03 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: Posting to perl.beginners via google groups
Message-Id: <slrngv8sqb.og2.whynot@orphan.zombinet>
On 2009-04-25, Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
> On 2009-04-24 00:00, Eric Pozharski <whynot@pozharski.name> wrote:
>> On 2009-04-22, Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
>
> [postings to a moderated group via google groups vanish]
>
>>> The moderator might not even get messages posted through google groups.
>>> For a moderated group, the newsserver where you post (Google Groups in
>>> this case) needs to be set up to send all postings by email to the
>>> moderator's address. The address is of course different for each
>>> moderated group, although many hierarchies have a common pattern. If
>>> Google Groups wasn't careful, they may send the submissions to
>>> perl-beginners@moderators.isc.org or something like that ...
>>
>> Google Groups isn't newsserver
>
> Of course it is. You can read and write usenet messages there and it
> exchanges these messages with other news servers. So it is a
> newsserver.
There's no NNTP capable software on this host --
As we already have seen, that "newsserver" doesn't listen on the
standard port. And it doesn't listen on the other port too:
{7342:10} [0:0]$ time telnet groups.google.com 433
Trying 74.125.39.101...
Trying 74.125.39.102...
Trying 74.125.39.113...
^C
real 6m22.382s
user 0m0.004s
sys 0m0.008s
{7758:11} [0:130]$
According to RFC3977, newsserver MUST send a greeting (section 3.1.).
Greetings are described in section 5.1.1.
{5732:7} [0:0]$ telnet groups.google.com www
Trying 209.85.137.100...
Connected to groups.l.google.com.
Escape character is '^]'.
Connection closed by foreign host.
{6114:8} [0:1]$
There's no greeting either.
Furthermore <http://www.disenter.com/>,
<http://ecalame.tripod.com/free.html>, <http://www.freeusenetnews.com/>
(3 leading lists of
<http://www.dmoz.org/Computers/Usenet/Public_News_Servers/>) don't list
groups.google.com as a newsserver.
"Usenet Improvement Project" was already mentioned.
I fail to see, how groups.google.com constitutes a "newsserver".
> It doesn't offer a (public) NNTP interface, but that is irrelevant for
> this problem.
I should admit that groups.google.com definetely provides functionality
(to some extent) of "newsreader". But then, OP shouldn't wait
newsserver capabilities from newsreader, should him?
--
Torvalds' goal for Linux is very simple: World Domination
Stallman's goal for GNU is even simpler: Freedom
------------------------------
Date: 26 Apr 2009 15:04:35 GMT
From: greymausg@mail.com
Subject: Tk::Listbox
Message-Id: <75jbg3F17dvkfU1@mid.individual.net>
I seem to be having areal problem with Tk::Listbox, wrote the script
http://sial.org/pbot/36228.
Which fails with error:
no event type or button # or keysym at
/usr/lib/perl5/site_perl/5.10.0/i486-linux-thread-multi/Tk/Widget.pm
line 1105, line 53092. at wordscan.pl line 23
In an effort to trace the problem, I downloaded the example codes
from Mastering Perl/Tk (oreilly) and my perl is having trouble with
Listbox in one of those scripts as well. Slackware 12.2, Perl 5.10.0
--
greymaus
.
.
...
------------------------------
Date: Sun, 26 Apr 2009 09:24:24 -0700
From: sln@netherlands.com
Subject: Re: Tk::Listbox
Message-Id: <se29v4tuhccdnadc0n3q0rcro1vh1br0an@4ax.com>
On 26 Apr 2009 15:04:35 GMT, greymausg@mail.com wrote:
>I seem to be having areal problem with Tk::Listbox, wrote the script
>
>http://sial.org/pbot/36228.
>
>Which fails with error:
>
>no event type or button # or keysym at
>/usr/lib/perl5/site_perl/5.10.0/i486-linux-thread-multi/Tk/Widget.pm
>line 1105, line 53092. at wordscan.pl line 23
>
>
>In an effort to trace the problem, I downloaded the example codes
>from Mastering Perl/Tk (oreilly) and my perl is having trouble with
>Listbox in one of those scripts as well. Slackware 12.2, Perl 5.10.0
http://www.perlmonks.org/index.pl?node_id=740491
Its probably an installation problem as mentioned in this thread.
Searching "no event type or button" pulls up pages of hits.
Seems Tk bugs are not being addressed. Most switch to Gtk, which
is supported better.
-sln
------------------------------
Date: 26 Apr 2009 18:04:35 GMT
From: greymausg@mail.com
Subject: Re: Tk::Listbox
Message-Id: <75jm1iF18aa7iU1@mid.individual.net>
On 2009-04-26, sln@netherlands.com <sln@netherlands.com> wrote:
> On 26 Apr 2009 15:04:35 GMT, greymausg@mail.com wrote:
>
>>I seem to be having areal problem with Tk::Listbox, wrote the script
>>
>>http://sial.org/pbot/36228.
>>
>>Which fails with error:
>>
>>no event type or button # or keysym at
>>/usr/lib/perl5/site_perl/5.10.0/i486-linux-thread-multi/Tk/Widget.pm
>>line 1105, line 53092. at wordscan.pl line 23
>>
>>
>>In an effort to trace the problem, I downloaded the example codes
>>from Mastering Perl/Tk (oreilly) and my perl is having trouble with
>>Listbox in one of those scripts as well. Slackware 12.2, Perl 5.10.0
>
> http://www.perlmonks.org/index.pl?node_id=740491
>
> Its probably an installation problem as mentioned in this thread.
> Searching "no event type or button" pulls up pages of hits.
> Seems Tk bugs are not being addressed. Most switch to Gtk, which
> is supported better.
>
Ta, very likely
--
greymaus
.
.
...
------------------------------
Date: 26 Apr 2009 18:38:36 GMT
From: greymausg@mail.com
Subject: Re: Tk::Listbox
Message-Id: <75jo1cF18cio8U1@mid.individual.net>
On 2009-04-26, greymausg@mail.com <greymausg@mail.com> wrote:
> On 2009-04-26, sln@netherlands.com <sln@netherlands.com> wrote:
>> On 26 Apr 2009 15:04:35 GMT, greymausg@mail.com wrote:
>>
>>>I seem to be having areal problem with Tk::Listbox, wrote the script
>>>
>>>http://sial.org/pbot/36228.
>>>
>>>Which fails with error:
>>>
>>>no event type or button # or keysym at
>>>/usr/lib/perl5/site_perl/5.10.0/i486-linux-thread-multi/Tk/Widget.pm
>>>line 1105, line 53092. at wordscan.pl line 23
>>>
>>>
>>>In an effort to trace the problem, I downloaded the example codes
>>>from Mastering Perl/Tk (oreilly) and my perl is having trouble with
>>>Listbox in one of those scripts as well. Slackware 12.2, Perl 5.10.0
>>
>> http://www.perlmonks.org/index.pl?node_id=740491
>>
>> Its probably an installation problem as mentioned in this thread.
>> Searching "no event type or button" pulls up pages of hits.
>> Seems Tk bugs are not being addressed. Most switch to Gtk, which
>> is supported better.
>>
>
> Ta, very likely
>
Just been looking into Gtk2.. any good sources, tutorials?
--
greymaus
.
.
...
------------------------------
Date: Sun, 26 Apr 2009 09:04:05 -0700
From: sln@netherlands.com
Subject: Re: unexplained warning message in m{...} regexp
Message-Id: <pu09v41esgpcafqs3edgn06hr05i5c39lv@4ax.com>
On Fri, 24 Apr 2009 06:06:03 -0700 (PDT), Klaus <klaus03@gmail.com> wrote:
>On Apr 24, 2:59 pm, Willem <wil...@snail.stack.nl> wrote:
>> Klaus wrote:
>>
>> ) You are right, in fact my regexp is anchored with \A and \z, so a
>> ) simple $_ eq '{0,0}' should suffice, that's easier to read and
>> ) probably much faster.
>> )
>> ) However, I maintain that a regexp m{\A\{0,0\}\z} should not emit a
>> ) warning message and I have filed a bugreport.
>>
>> Then how are you supposed to put a quantifier in an m{...} expression ?
>
>By not escaping the curlies { }, for example
>
>m{a{1,2}} matches 'a' or 'aa'
>m{a\{1,2\}} matches 'a{1,2}'
^^^^^^^^^^^^^
These look identical, matching 'a' or 'aa'.
I think thats the point, escapes are striped on delimeters with closure's.
The same thing happesn when using () as delimeters.
This is not the case with single character delimiters.
-sln
-----------------------
Output:
(?-xism:a{1,2})
(?-xism:a{1,2})
(?-xism:(a{1,2}))
(?-xism:(a{1,2}))
(?-xism:/a{1,2}/)
------------------------
use strict;
use warnings;
my $rx1 = qr {a{1,2}};
my $rx2 = qr {a\{1,2\}};
print $rx1,"\n";
print $rx2,"\n";
my $rx3 = qr ((a{1,2}));
my $rx4 = qr (\(a{1,2}\));
print $rx3,"\n";
print $rx4,"\n";
my $rx5 = qr /\/a{1,2}\//;
print $rx5,"\n";
------------------------------
Date: Sun, 26 Apr 2009 19:25:10 GMT
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: unexplained warning message in m{...} regexp
Message-Id: <slrngv9d8m.dsq.nospam-abuse@chorin.math.berkeley.edu>
On 2009-04-25, Klaus <klaus03@gmail.com> wrote:
>> [There are two different mechanisms of unescaping in the lifetime of
>> a REx.
>>
>> a) First, the parser removes delimiters
>
> Ok, so far I am with you.
>
>> (and unescapes escaped delimiters)
>> (it may also remove certain other escapes - do not remember details).
>
> Why unescaping escaped delimiters ?
The step "b" knows nothing about delimiters (it operates on strings).
The "native operation" of step "b" is as in
my $foo = WHATEVER;
/$foo/;
>> b) The result is passed to REx engine. It processes all the
>> remaining special-for-REx escapes.
Yours,
Ilya
------------------------------
Date: Sun, 26 Apr 2009 19:34:08 GMT
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: unexplained warning message in m{...} regexp
Message-Id: <slrngv9dpg.dsq.nospam-abuse@chorin.math.berkeley.edu>
On 2009-04-25, Klaus <klaus03@gmail.com> wrote:
> A '{' in /a{0,0}/
> is a metacharacter and always comes paired with a '}'. Those { }
> metacharacters are never escaped in a regexp.
> The '{' in '{0,0' is a literal curly, and they, of course, can come in
> any number or combination. Any { } literal has to be always escaped in
> a regexp.
I do not think this makes a lot of sense (especially "has to be"). I
can read it (because I knew already the ideas you wanted to express),
but I'm pretty sure it would confuse many other readers...
[The semantic of `{' in a REx is nothing to proud of (I mean the
fact that it DWIMs, so one can never be sure). I think this
semantic is inherited from Henri's old implementation.]
=======================================================
In a saner Perl, /a{0,0/ would be a syntax error. But it is not, and
it is accepted as a literal string match.
So "unless one is really-really sure" they know what they are doing,
literal `{' should better be escaped, since SOMETIMES it is may be
interpreted as a metachar...
Ilya
------------------------------
Date: Sun, 26 Apr 2009 13:09:17 -0700
From: sln@netherlands.com
Subject: Re: unexplained warning message in m{...} regexp
Message-Id: <a8e9v45qns51s0u36mcnh6lomo4jvu22dc@4ax.com>
On Sun, 26 Apr 2009 09:04:05 -0700, sln@netherlands.com wrote:
>On Fri, 24 Apr 2009 06:06:03 -0700 (PDT), Klaus <klaus03@gmail.com> wrote:
>
>>On Apr 24, 2:59 pm, Willem <wil...@snail.stack.nl> wrote:
>>> Klaus wrote:
>>>
>>> ) You are right, in fact my regexp is anchored with \A and \z, so a
>>> ) simple $_ eq '{0,0}' should suffice, that's easier to read and
>>> ) probably much faster.
>>> )
>>> ) However, I maintain that a regexp m{\A\{0,0\}\z} should not emit a
>>> ) warning message and I have filed a bugreport.
>>>
>>> Then how are you supposed to put a quantifier in an m{...} expression ?
>>
>>By not escaping the curlies { }, for example
>>
>>m{a{1,2}} matches 'a' or 'aa'
>>m{a\{1,2\}} matches 'a{1,2}'
> ^^^^^^^^^^^^^
>These look identical, matching 'a' or 'aa'.
>I think thats the point, escapes are striped on delimeters with closure's.
>The same thing happesn when using () as delimeters.
>This is not the case with single character delimiters.
>
Looking at it again, all escaped delimiters are unescaped by the parser
before it gets to the regex engine (Illya's step a.).
So, if you will be looking for thier literals,
I guess the trick is to *not* use a delimiter that is/are regex metachars; the escape itself '\',
nor {},+*.?, nor paranthetical grouping (), nor character class [], etc..
As luck would have it there is the forward slash '/' and many more.
qr {a{1,2}} ~ (?-xism:a{1,2})
qr {a\{1,2\}} ~ (?-xism:a{1,2})
qr ((a{1,2})) ~ (?-xism:(a{1,2}))
qr (\(a{1,2}\)) ~ (?-xism:(a{1,2}))
qr [\[a{1,2}\]] ~ (?-xism:[a{1,2}])
qr /\/a{1,2}\// ~ (?-xism:/a{1,2}/)
Thanks for this exercise.
-sln
------------------------------
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 2369
***************************************