[31890] in Perl-Users-Digest
Perl-Users Digest, Issue: 3153 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 29 18:09:25 2010
Date: Wed, 29 Sep 2010 15: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 Wed, 29 Sep 2010 Volume: 11 Number: 3153
Today's topics:
Re: Is $A = $B = n; valid? <peter@makholm.net>
Re: Is $A = $B = n; valid? <rvtol+usenet@xs4all.nl>
Re: Long script "just stops" sometime <hjp-usenet2@hjp.at>
Re: Need Regex for phone number <bart.lateur@telenet.be>
Re: Need Regex for phone number <marc.girod@gmail.com>
Re: Need Regex for phone number <cwilbur@chromatico.net>
Re: Need Regex for phone number <tzz@lifelogs.com>
Re: Need Regex for phone number <tadmc@seesig.invalid>
Re: Time::Format::time with $SIG{__DIE__} problem <google@markginsburg.com>
Re: Time::Format::time with $SIG{__DIE__} problem <kst-u@mib.org>
Re: Time::Format::time with $SIG{__DIE__} problem sln@netherlands.com
Re: Time::Format::time with $SIG{__DIE__} problem <google@markginsburg.com>
Re: toy list processing problem: collect similar terms <w_a_x_man@yahoo.com>
Using a backref for arity <akim.demaille@gmail.com>
Re: Using a backref for arity <jwkrahn@example.com>
Re: Using a backref for arity <akim.demaille@gmail.com>
Re: Using a backref for arity <ben@morrow.me.uk>
Re: Using a backref for arity sln@netherlands.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 29 Sep 2010 07:04:10 +0200
From: Peter Makholm <peter@makholm.net>
Subject: Re: Is $A = $B = n; valid?
Message-Id: <87vd5p16ph.fsf@vps1.hacking.dk>
"John W. Krahn" <jwkrahn@example.com> writes:
> Why the overhead of a subroutine call? Just use a macro which gets
> removed at compile time:
My guess is that this is just an example and not real production ready
code.
//Makholm
------------------------------
Date: Wed, 29 Sep 2010 09:26:08 +0200
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: Is $A = $B = n; valid?
Message-Id: <4ca2ea10$0$41105$e4fe514c@news.xs4all.nl>
On 2010-09-29 03:53, John W. Krahn wrote:
> Peter Makholm wrote:
>> "Dr.Ruud"<rvtol+usenet@xs4all.nl> writes:
>>> On 2010-09-28 00:11, Joey@still_Learning.invalid wrote:
>>>> Is the syntax $A = $B = $C = number acceptable?
>>
>>> my $foo = my $bar = my $baz = number;
>>
>> While perfectly fine, I would probably write this as
>>
>> my ($foo, $bar, $baz) = (number) x 3;
>
> $_ = number for my ( $foo, $bar, $baz );
{ my $i = 42;
sub number { ++$i }
}
--
Ruud
------------------------------
Date: Wed, 29 Sep 2010 18:18:11 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Long script "just stops" sometime
Message-Id: <slrnia6pm3.e8.hjp-usenet2@hrunkner.hjp.at>
On 2010-09-29 01:07, Xho Jingleheimerschmidt <xhoster@gmail.com> wrote:
> Peter J. Holzer wrote:
>> On 2010-09-26 23:06, Xho Jingleheimerschmidt <xhoster@gmail.com> wrote:
>>> Peter J. Holzer wrote:
>>>> In this case, if your guess is right, strace would show that the
>>>> process is currently waiting for a read on fd 0 to complete, and
>>>> then lsof could be used to find out which file fd 0 is (ok, so for
>>>> fd 0 you may know that it's the tty, for for (say) fd 43 you want a
>>>> tool to look it up).
>>> Unfortunately, if you use strace "-p" option to attach to an
>>> already-running process, if often doesn't show you what call the process
>>> was waiting on at the time of the attachment.
>>
>> I don't think that ever happened to me in many years of using strace.
>> Except with multithreaded processes, but for those strace doesn't work
>> reliably anyway (I don't understand why).
>
> This is what I get:
>
> $ perl -le '<>' &
> [1] 17657
Here I get
[1] + suspended (tty input) perl -le '<>'
(I expected that. A background process should not be able to
read from the TTY)
strace then very rapidly prints
read(0, 0x8bc1c90, 4096) = ? ERESTARTSYS (To be
restarted)
--- SIGTTIN (Stopped (tty input)) @ 0 (0) ---
--- SIGTTIN (Stopped (tty input)) @ 0 (0) ---
read(0, 0x8bc1c90, 4096) = ? ERESTARTSYS (To be
restarted)
--- SIGTTIN (Stopped (tty input)) @ 0 (0) ---
--- SIGTTIN (Stopped (tty input)) @ 0 (0) ---
...
If I try that again without the "&", and start strace in another
terminal, I get:
% strace -p 27233
Process 27233 attached - interrupt to quit
read(0,
and the cursor is to the right of "read(0, ", indicating that the read
system call is still in progress. The line is completed as soon as the
system call returns.
(Linux 2.6.32-5-686, strace 4.5.20-2, but AFAIR it was always like this)
hp
------------------------------
Date: Wed, 29 Sep 2010 10:01:37 +0200
From: Bart Lateur <bart.lateur@telenet.be>
Subject: Re: Need Regex for phone number
Message-Id: <lgs5a6hk6pibpenleu59iruo0ln3rju13p@4ax.com>
Charlton Wilbur wrote:
> We have a text-input field that we ask the user to type a
> telephone number into. As part of data validation, we need to
> know if it's a valid phone number and to identify the area
> code. Please write some code to do that.
The only way to really be sure is to call up the number.
Yes, it is indeed similar to the problem of checking if an email address
is valid.
--
Bart.
------------------------------
Date: Wed, 29 Sep 2010 13:25:49 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: Need Regex for phone number
Message-Id: <34405e22-b30d-4389-b2c3-beb1218a01be@n3g2000yqb.googlegroups.com>
On Sep 28, 6:05=A0pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
> You'd think that - but in practice, there are a lot of people who
> present themselves as Perl experts convincingly enough to get past HR
> people and generalist recruiters.
This kind of interview strategy does select some people and reject
others.
Whether the people selected are more suitable to the job than the
people rejected is questionable. It is only obvious to certain kinds
of people. It is not to others.
To make it simple, my theory is that there are people who like
questions and people who like answers.
People who like answers believe that people who like answers are
better.
There is no way on earth to contradict them.
I tend to get rejected in such tests. It doesn't seem to depend on the
area of expertise.
I have also been in situation to test people. I did select somebody.
Marc
------------------------------
Date: Wed, 29 Sep 2010 16:55:15 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Need Regex for phone number
Message-Id: <864od89sng.fsf@mithril.chromatico.net>
>>>>> "MG" == Marc Girod <marc.girod@gmail.com> writes:
MG> On Sep 28, 6:05 pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
>> You'd think that - but in practice, there are a lot of people who
>> present themselves as Perl experts convincingly enough to get
>> past HR people and generalist recruiters.
MG> This kind of interview strategy does select some people and
MG> reject others.
That's exactly the point.
MG> Whether the people selected are more suitable to the job than
MG> the people rejected is questionable. It is only obvious to
MG> certain kinds of people. It is not to others.
If you don't have basic Perl knowledge -- and a level of regular
expressions knowledge sufficient to make at least a reasonable attempt
at solving that problem -- then you are unsuited to a position where you
will be expected to program in Perl. Since programming in Perl is a
primary requirement for the positions I'm interviewing candidates for,
assessing whether or not they have a working knowledge of basic to
intermediate Perl is one of my primary goals in the interview.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Wed, 29 Sep 2010 16:09:38 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Need Regex for phone number
Message-Id: <87aan0w92l.fsf@lifelogs.com>
On Tue, 28 Sep 2010 13:05:04 -0400 Charlton Wilbur <cwilbur@chromatico.net> wrote:
CW> You'd think that - but in practice, there are a lot of people who
CW> present themselves as Perl experts convincingly enough to get past HR
CW> people and generalist recruiters.
"Would you describe yourself as a scalar, list, or hash and why?"
"If you could be any CPAN module, which would you choose and why?"
"How does Perl 6 make you feel?"
"Do you play golf?"
Ted
------------------------------
Date: Wed, 29 Sep 2010 16:39:13 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Need Regex for phone number
Message-Id: <slrnia7ci1.bud.tadmc@tadbox.sbcglobal.net>
Ted Zlatanov <tzz@lifelogs.com> wrote:
> On Tue, 28 Sep 2010 13:05:04 -0400 Charlton Wilbur <cwilbur@chromatico.net> wrote:
>
> CW> You'd think that - but in practice, there are a lot of people who
> CW> present themselves as Perl experts convincingly enough to get past HR
> CW> people and generalist recruiters.
>
> "Would you describe yourself as a scalar, list, or hash and why?"
All of them, I am a glob. Because I'm da man!
> "If you could be any CPAN module, which would you choose and why?"
Acme::Bundle, 'cause those guys are a hoot!
> "How does Perl 6 make you feel?"
Squishy (plus it's 2 better than Perl 4).
> "Do you play golf?"
no
(that's not really the answer, because that would cost 1 more stroke...)
--
Rest In Peace:
Jonah McClellan gave his life for his country in a
helicopter crash in Afghanistan on September 21,2010.
Please pray for his wife and three children.
------------------------------
Date: Wed, 29 Sep 2010 09:20:21 -0700 (PDT)
From: Mark <google@markginsburg.com>
Subject: Re: Time::Format::time with $SIG{__DIE__} problem
Message-Id: <c4f08cdd-ada8-454a-b4d4-6002d763ebc3@e14g2000yqe.googlegroups.com>
On Sep 28, 8:28=A0pm, "C.DeRykus" <dery...@gmail.com> wrote:
> Hm, I see $^S set to 1 in the handler which
> indicates the interpreter is executing an eval.
> This workaround appears to make the message
> go away but I'm not sure if it's advisable:
>
> $SIG{'__DIE__'} =3D
> =A0 =A0 sub { return if $^S; =A0 # ignore if eval
> =A0 =A0 =A0 =A0 =A0 print("I'm dying.... Reason: $_[0]\n");
> =A0 =A0 =A0 =A0 =A0 exit(1);
> =A0 =A0 =A0 =A0 };
>
Yes. That works for me too. I erred when I reported the value of $^S
was 0.
> return if $^S; # ignore if eval
I am thinking the following might be better:
return() unless defined $^S and $^S =3D=3D 0; # ignore unless program exit
Thank you Charles.
------------------------------
Date: Wed, 29 Sep 2010 12:29:31 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Time::Format::time with $SIG{__DIE__} problem
Message-Id: <lnocbg5ox0.fsf@nuthaus.mib.org>
Mark <google@markginsburg.com> writes:
> On Sep 28, 3:14Â pm, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrote:
>> __DIE__ handlers should check $^S. Is not it LOUDLY documented?
>
> I could not find anything in perlipc or perlvar about using $^S. I
> could only find it's possible values documented in perlipc.
>
> Perhaps someone would be kind enough to suggest a better place to
> look?
See the end of "perldoc -f die".
See also the "%SIG" section of "perldoc perlvar", and the BUGS section
at the very end:
Having to even think about the $^S variable in your exception
handlers is simply wrong. $SIG{__DIE__} as currently
implemented invites grievous and difficult to track down
errors. Avoid it and use an "END{}" or CORE::GLOBAL::die
override instead.
[...]
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
------------------------------
Date: Wed, 29 Sep 2010 12:33:58 -0700
From: sln@netherlands.com
Subject: Re: Time::Format::time with $SIG{__DIE__} problem
Message-Id: <j047a61k3cdfrmv1n9gdd8livi9nunnsso@4ax.com>
On Wed, 29 Sep 2010 09:20:21 -0700 (PDT), Mark <google@markginsburg.com> wrote:
>On Sep 28, 8:28 pm, "C.DeRykus" <dery...@gmail.com> wrote:
>
>> return if $^S; # ignore if eval
>
>I am thinking the following might be better:
>
>return() unless defined $^S and $^S == 0; # ignore unless program exit
unless defined $^S and $^S == 0 will will be true if:
$^S < 0 || undef || $^S > 0
if $^S will will be true if:
$^S < 0 || $^S > 0
Is that what you want?
-sln
------------------------------
Date: Wed, 29 Sep 2010 15:07:48 -0700 (PDT)
From: Mark <google@markginsburg.com>
Subject: Re: Time::Format::time with $SIG{__DIE__} problem
Message-Id: <e90545fb-edd3-4163-943b-fee594d493a3@28g2000yqm.googlegroups.com>
On Sep 29, 12:33=A0pm, s...@netherlands.com wrote:
> >I am thinking the following might be better:
>
> >return() unless defined $^S and $^S =3D=3D 0; # ignore unless program ex=
it
>
> unless defined $^S and $^S =3D=3D 0 will will be true if:
> =A0$^S < 0 || undef || $^S > 0
>
> if $^S will will be true if:
> =A0$^S < 0 || $^S > 0
>
> Is that what you want?
I don't think so, but I'm in a bit over my head here.
According to perlvar:
$^S State
--------- -------------------
undef Parsing module/eval
true (1) Executing an eval
false (0) Otherwise
So I think I should return immediately for cases where $^S is undef as
well as equal to 1 as I only want to deal with abnormal code
termination, for instance due to a call to die.
"perldoc -f die" suggests putting "die @_ if $^S;" as the first line
of the sig die handler. But that wouldn't
handle the case where the handler was called when "parsing module/
eval". I have never seen this happen but I
feel that handling this case as well would be prudent.
------------------------------
Date: Wed, 29 Sep 2010 07:04:26 -0700 (PDT)
From: w_a_x_man <w_a_x_man@yahoo.com>
Subject: Re: toy list processing problem: collect similar terms
Message-Id: <cc1d4f99-3019-4d05-ac95-db647cab7cef@h7g2000yqn.googlegroups.com>
On Sep 26, 9:24=A0am, p...@informatimago.com (Pascal J. Bourguignon)
wrote:
> Xah Lee <xah...@gmail.com> writes:
> > here's a interesting toy list processing problem.
>
> > I have a list of lists, where each sublist is labelled by
> > a number. I need to collect together the contents of all sublists
> > sharing
> > the same label. So if I have the list
>
> > ((0 a b) (1 c d) (2 e f) (3 g h) (1 i j) (2 k l) (4 m n) (2 o p) (4 q
> > r) (5 s t))
>
> > where the first element of each sublist is the label, I need to
> > produce:
>
> > output:
> > ((a b) (c d i j) (e f k l o p) (g h) (m n q r) (s t))
>
> > a Mathematica solution is here:
> >http://xahlee.org/UnixResource_dir/writ/notations_mma.html
>
> > R5RS Scheme lisp solution:
> >http://xahlee.org/UnixResource_dir/writ/Sourav_Mukherjee_sourav.work_...
> > by Sourav Mukherjee
>
> > also, a Common Lisp solution can be found here:
> >http://groups.google.com/group/comp.lang.lisp/browse_frm/thread/5d1de...
>
> It's too complex. Just write:
>
> (let ((list '((0 a b) (1 c d) (2 e f) (3 g h) (1 i j) (2 k l) (4 m n)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (2 o p) (4 q r) (5 s t))))
>
> =A0 (mapcar (lambda (class) (reduce (function append) class :key (functio=
n rest)))
> =A0 =A0 =A0 =A0 =A0 =A0(com.informatimago.common-lisp.list:equivalence-cl=
asses list :key (function first)))
>
> =A0 =A0)
>
> --> ((S T) (Q R M N) (G H) (O P K L E F) (I J C D) (A B))
>
> --
> __Pascal Bourguignon__ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0http://www.=
informatimago.com/
Ruby:
[[0, 'a', 'b'], [1, 'c', 'd'], [2, 'e', 'f'], [3, 'g', 'h'], [1,
'i', 'j'], [2, 'k', 'l'], [4, 'm', 'n'], [2, 'o', 'p'], [4, 'q', 'r'],
[5, 's', 't']].
group_by{|x| x.first}.values.map{|x| x.map{|y| y[1..-1]}.flatten}
=3D=3D>[["s", "t"], ["a", "b"], ["c", "d", "i", "j"],
["e", "f", "k", "l", "o", "p"],
["g", "h"], ["m", "n", "q", "r"]]
------------------------------
Date: Wed, 29 Sep 2010 03:04:14 -0700 (PDT)
From: Akim Demaille <akim.demaille@gmail.com>
Subject: Using a backref for arity
Message-Id: <35a39e34-ae7e-4517-abd8-c8e789e12fa6@a19g2000yql.googlegroups.com>
Hi all,
The following does not work. This was expected, but since pre is
sometimes surprisingly powerful, I meant to make sure. The idea is to
handle with the s operator strings of x's preceded by their number
(and for instance to replace them with X). For instance "{2}xxx"
should give "XXx". So I tried this:
echo "{2}xxx" | perl -p -e 's/\{(\d+)\}x{\1}/"X" x $1/ge
Sure it does not work (I get the original string back). Yet, I would
have expected Perl to complain about my use of the backref as an
argument for the arity (this is 5.10.0). What the heck did it
understand?
Thanks in advance.
------------------------------
Date: Wed, 29 Sep 2010 03:18:15 -0700
From: "John W. Krahn" <jwkrahn@example.com>
Subject: Re: Using a backref for arity
Message-Id: <HnEoo.21373$qU5.21330@newsfe20.iad>
Akim Demaille wrote:
>
> The following does not work. This was expected, but since pre is
> sometimes surprisingly powerful, I meant to make sure. The idea is to
> handle with the s operator strings of x's preceded by their number
> (and for instance to replace them with X). For instance "{2}xxx"
> should give "XXx". So I tried this:
>
> echo "{2}xxx" | perl -p -e 's/\{(\d+)\}x{\1}/"X" x $1/ge
$ echo "{2}xxx" | perl -p -e 's/\{(\d+)\}(x+)/substr $a = $2, 0, $1, "X"
x $1; $a /ge'
XXx
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
------------------------------
Date: Wed, 29 Sep 2010 04:34:15 -0700 (PDT)
From: Akim Demaille <akim.demaille@gmail.com>
Subject: Re: Using a backref for arity
Message-Id: <837cff4c-0a06-4a14-ab52-4506c12d89fb@a9g2000yqg.googlegroups.com>
On Sep 29, 12:18=A0pm, "John W. Krahn" <jwkr...@example.com> wrote:
> Akim Demaille wrote:
>
> > The following does not work. =A0This was expected, but since pre is
> > sometimes surprisingly powerful, I meant to make sure. =A0The idea is t=
o
> > handle with the s operator strings of x's preceded by their number
> > (and for instance to replace them with X). =A0For instance "{2}xxx"
> > should give "XXx". =A0So I tried this:
>
> > echo "{2}xxx" | perl -p -e 's/\{(\d+)\}x{\1}/"X" x $1/ge
>
> $ echo "{2}xxx" | perl -p -e 's/\{(\d+)\}(x+)/substr $a =3D $2, 0, $1, "X=
"
> x $1; $a /ge'
> XXx
Thanks for this. I have to add a check to make sure that we don't
overrun the available space (see for instance:
$ echo "{4}xx" | perl -p -e 's/\{(\d+)\}(x+)/substr $a =3D $2, 0, $1,
"X" x $1; $a /ge'
XXXX
)
I know I can do that, no problem. But still, I am really curious to
know what Perl understood here, since it did not complain about this
weird arity argument.
------------------------------
Date: Wed, 29 Sep 2010 13:03:18 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Using a backref for arity
Message-Id: <6hmbn7-h0l2.ln1@osiris.mauzo.dyndns.org>
Quoth Akim Demaille <akim.demaille@gmail.com>:
>
> The following does not work. This was expected, but since pre is
> sometimes surprisingly powerful, I meant to make sure. The idea is to
> handle with the s operator strings of x's preceded by their number
> (and for instance to replace them with X). For instance "{2}xxx"
> should give "XXx". So I tried this:
>
> echo "{2}xxx" | perl -p -e 's/\{(\d+)\}x{\1}/"X" x $1/ge
>
> Sure it does not work (I get the original string back). Yet, I would
> have expected Perl to complain about my use of the backref as an
> argument for the arity (this is 5.10.0). What the heck did it
> understand?
~% perl -Mre=debug -e'qr/\{(\d+)\}x{\1}/'
Compiling REx "\{(\d+)\}x{\1}"
Final program:
1: EXACT <{> (3)
3: OPEN1 (5)
5: PLUS (7)
6: DIGIT (0)
7: CLOSE1 (9)
9: EXACT <}x{> (11)
11: REF1 (13)
13: EXACT <}> (15)
15: END (0)
anchored "{" at 0 floating "}x{" at 2..2147483647 (checking floating)
minlen 6
Freeing REx: "\{(\d+)\}x{\1}"
So it interpreted it as /\{(\d+)\}x\{\1\}/: that is, it took the second
set of curlies as literal curlies, rather than a count.
Ben
------------------------------
Date: Wed, 29 Sep 2010 08:17:24 -0700
From: sln@netherlands.com
Subject: Re: Using a backref for arity
Message-Id: <vfl6a6tbg1uncvfi0os062p1043k09gbsj@4ax.com>
On Wed, 29 Sep 2010 03:04:14 -0700 (PDT), Akim Demaille <akim.demaille@gmail.com> wrote:
>Hi all,
>
>The following does not work. This was expected, but since pre is
>sometimes surprisingly powerful, I meant to make sure. The idea is to
>handle with the s operator strings of x's preceded by their number
>(and for instance to replace them with X). For instance "{2}xxx"
>should give "XXx". So I tried this:
>
>echo "{2}xxx" | perl -p -e 's/\{(\d+)\}x{\1}/"X" x $1/ge
>
>Sure it does not work (I get the original string back). Yet, I would
>have expected Perl to complain about my use of the backref as an
>argument for the arity (this is 5.10.0). What the heck did it
>understand?
>
>Thanks in advance.
Using Perl 5.10.0 --
Windows:
echo "{2}xxx" | perl -p -e "s/\{(\d+)\}(??{\"x{$1}\"})/\"X\" x $1/ge"
Nix (untested):
echo "{2}xxx" | perl -p -e 's/\{(\d+)\}(??{"x{$1}"})/"X" x $1/ge'
From perlre:
(??{ code })
WARNING: This extended regular expression feature is considered experimental,
and may be changed without notice. Code executed that has side effects may
not perform identically from version to version due to the effect of future
optimisations in the regex engine.
This is a "postponed" regular subexpression. The code is evaluated at
run time, at the moment this subexpression may match. The result of evaluation
is considered as a regular expression and matched as if it were inserted
instead of this construct. Note that this means that the contents of capture
buffers defined inside an eval'ed pattern are not available outside of the
pattern, and vice versa,
there is no way for the inner pattern to refer to a capture buffer defined outside.
---------------------------------
" there is no way for the inner pattern to refer to a capture buffer defined outside. "
^^^
Strangely enough, in this example, the inner pattern refers to an outside capture buffer.
So the feature may have changed thus, validating "may be changed without notice" ...
Expanded:
s/ \{ (\d+) \} (??{ "x{$1}" }) /"X" x $1/xge
-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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 3153
***************************************