[tpm] problems with what regex returns ... in context ?

Rob Janes janes.rob at gmail.com
Fri May 10 14:01:17 PDT 2013


if (my @cap = /$regex/) {
@cap = ($&) unless defined $1;
foreach @cap {
do something;
}
}
On May 10, 2013 4:47 PM, "Quantum Mechanic" <quantum.mechanic.1964 at gmail.com>
wrote:

>
> On Fri, May 10, 2013 at 1:33 PM, Quantum Mechanic <
> quantum.mechanic.1964 at gmail.com> wrote:
>
>> I would have tried "my" instead of the punctuation variables:
>>
>> if (my @capture = /$regex/) {
>>     foreach @capture {
>>         do something;
>>     }
>> }
>>
>
> That doesn't make any difference, @capture still (seems to get) the 1/true
> result code
> when there is no capturing.
>
>
>
> It should create a new @capture each time. It doesn't always capture
> something, right? I'll have to try it when I get home.
>
>
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20130510/4ae1b151/attachment.html>


More information about the toronto-pm mailing list