Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Web based perl REPL

by NetWallah (Canon)
on Dec 04, 2006 at 04:10 UTC ( #587574=note: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://587574]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2021-06-19 09:57 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (91 votes). Check out past polls.