in reply to Re: How is this printing?
in thread How is this printing?

IIRC all $n variables get reset whenever a new regexp is uh... "done" (hope you understand me). Correct me if I'm wrong.




"2b"||!"2b";$$_="the question"
Besides that, my code is untested unless stated otherwise.
One more: please review the article about regular expressions (do's and don'ts) I'm working on.

Replies are listed 'Best First'.
Re^3: How is this printing?
by Sandy (Curate) on Oct 19, 2004 at 17:04 UTC
    Nope, I'm not exactly sure if I understand what you are asking, but here's my best guess...

    Consider the following code and result

    foreach ("abc123", "xyz123","def12","ghi123") { /(.*)123/; print "scanning $_: found $1\n"; } __DATA__ scanning abc123: found abc scanning xyz123: found xyz scanning def12: found xyz scanning ghi123: found ghi <code> Notice that while scanning "<code>def12
    " the "$1" variable was not reset to undef but remains in its previously defined state.

    Was this what you were asking?