Patrick surmised:
So I'm guessing that we're all in agreement that +$/, +$1, and
+$ all refer to the numeric value of the string matched,
as opposed to what's currently written about their values in the
draft...?
Yes. The semantics proposed in the draft have proved to be too orthogonal for
prac
On Thu, May 12, 2005 at 08:10:42PM -0700, Larry Wall wrote:
> On Thu, May 12, 2005 at 02:55:36PM -0500, Patrick R. Michaud wrote:
> : On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote:
> : > Is it really intended that we get into habit of writing this?
> : >
> : > if 'localhost:80'
On Thu, May 12, 2005 at 08:10:42PM -0700, Larry Wall wrote:
> On Thu, May 12, 2005 at 02:55:36PM -0500, Patrick R. Michaud wrote:
> : My suggestion is that a match object in numeric context is the
> : same as evaluating its string value in a numeric context. If
> : we need a way to find out the nu
On Fri, May 13, 2005 at 02:00:10PM +1000, Damian Conway wrote:
: >Actually, it's not clear to me offhand why @1 shouldn't mean $1[]
: >and %1 shouldn't mean $1{}.
:
: It *does*. According to the recent capture semantics document:
:
:> Note that, outside a rule, C<@1> is simply a shorthand for
Larry Wall wrote:
I think we already said something like that once some number of
months ago. +$1 simply has to be the numeric value of the match.
Agreed.
Anyway, while we could have
a method for the .matchcount, +$1[] should work fine too.
Yep.
Actually, it's not clear to me offhand why @1 sho
On Thu, May 12, 2005 at 02:55:36PM -0500, Patrick R. Michaud wrote:
: On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote:
: > Is it really intended that we get into habit of writing this?
: >
: > if 'localhost:80' ~~ /^(.+)\:(\d+)$/ {
: > my $socket = connect(~$0, +$1);
: >
On 5/12/05, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote:
> On Thu, May 12, 2005 at 02:55:36PM -0500, Patrick R. Michaud wrote:
> > On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote:
> > > Is it really intended that we get into habit of writing this?
> > >
> > > if 'localhost:80' ~
On Thu, May 12, 2005 at 02:55:36PM -0500, Patrick R. Michaud wrote:
> On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote:
> > Is it really intended that we get into habit of writing this?
> >
> > if 'localhost:80' ~~ /^(.+)\:(\d+)$/ {
> > my $socket = connect(~$0, +$1);
> >
On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote:
> Is it really intended that we get into habit of writing this?
>
> if 'localhost:80' ~~ /^(.+)\:(\d+)$/ {
> my $socket = connect(~$0, +$1);
> }
>
> It looks... weird. :)
And it would have to be
if 'localhost:80'
Thit has led to surprising results in Pugs's Net::IRC:
if 'localhost:80' ~~ /^(.+)\:(\d+)$/ {
my $socket = connect($0, $1);
}
If $1 is a match object here, and connect() assumes Int on its second
argument, then it will connect to port 1, as the match object numifies
to 1 (indicati
10 matches
Mail list logo