On Thu, Sep 21, 2006 at 10:20:20PM -0700, Jonathan Lang wrote:
: Two questions:
:
: 1. How would the capture sigil affect the use of capture objects as
: replacements for perl5's references?
I don't see how it would have any effect at all, unless the P5 ref happened
to be to a typeglob, or had
Larry Wall wrote:
Jonathan Lang wrote:
: Two questions:
:
: 1. How would the capture sigil affect the use of capture objects as
: replacements for perl5's references?
I don't see how it would have any effect at all, unless the P5 ref happened
to be to a typeglob, or had both array and hash
On Fri, Sep 22, 2006 at 12:32:27AM -0700, Jonathan Lang wrote:
: Larry Wall wrote:
: Jonathan Lang wrote:
: : Two questions:
: :
: : 1. How would the capture sigil affect the use of capture objects as
: : replacements for perl5's references?
:
: I don't see how it would have any effect at all,
Larry Wall wrote:
: This would mean that the rules for capturing are as follows:
:
: * Capturing something in scalar context: If it is a pair, it is
: captured as a named argument; otherwise, it is captured as the
: invocant.
:
: * Capturing something in list context: Pairs are captured as named
Larry Wall wrote:
You don't need to use | to store a capture any more than you need @ to
store an array. Just as
$x = @b;
@$x;
gives you the original array,
Huh. I'm not used to this happening. So what would the following
code do, and why?
my @b = ('foo', 'bar');
my $x =
Jonathan Lang wrote:
Larry Wall wrote:
You don't need to use | to store a capture any more than you need @ to
store an array. Just as
$x = @b;
@$x;
gives you the original array,
Huh. I'm not used to this happening. So what would the following
code do, and why?
my @b = ('foo',
From S05:
If a subrule appears two (or more) times in any branch of a lexical
scope (i.e. twice within the same subpattern and alternation), or if the
subrule is quantified anywhere within a given scope, then its
corresponding hash entry is always assigned an array of
CMatch objects rather than
On Fri, Sep 22, 2006 at 10:22:52PM +0800, Audrey Tang wrote:
Moreover:
/foo bar bar foo+/
should set $foo to an Array with two Match elements, the first being a
simple match, and the second has multiple positional submatches.
The thinking behind the separate treatment is that in a
2006/9/22, Patrick R. Michaud [EMAIL PROTECTED]:
Out of curiosity, why not:
/foo bar bar $xyz:=(foo+)/
and then one can easily look at $xyz.from and $xyz.to, as well
as get to the arrayed elements? (There are other possibilities as
well.)
I'm not arguing in favor of or against the
Aaron Sherman wrote:
IMHO most of the confusion here goes away if capture variables ONLY
store parameter-list-like captures, and any other kind of capture
should, IMHO, permute itself into such a structure if you try to store
it into one. That way, their use is carefully constrained to the
10 matches
Mail list logo