Hi All,

A simple question (but this had me baffled for ages today).

Take a statement such as the following:

if (s!($string)!!g)
{
    # code
}

Since we are using the g modifier in the substitution, is
there a way to access an array or something which holds all
the captured matches (assuming there are multiple matches)
in the global replace? Obviously $1 doesn't work (even if it
did, it'll probably only give me the most recent match).

I know that I can use

while (s!($string)!!)
{
    # access to $1 is allowed here
}

but I'm curious to know the answer to my question above.

Thank you gurus.
Mk

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to