in reply to Web based perl REPL

This is not behaving as I expect, when matching a single Regex:
> my $x='this is a test' this is a test > $x=~m/(.+)a/ 1 > $1 > print $1 1
I was expecting $1 to contain "this is ".
++ anyway, for a good idea looking for an application.

Update:I can get the results I want using alternative syntax:

> my $x='This is a test for web perl parsing'; This is a test for web perl parsing > my ($what_test) = $x =~m/for (.+)/; 1> $what_test web perl parsing
So Regexen work fine - its just the $1..$n appear not to be available.

     "A closed mouth gathers no feet." --Unknown

Replies are listed 'Best First'.
Re^2: Web based perl REPL
by BUU (Prior) on Dec 04, 2006 at 08:03 UTC
    You're losing $1 because it's doing other regexen in between executions.