in reply to Re: Simple (probably)
in thread Simple (probably)

I appreciate your explanations. Very succinct teacher. Kind of unrelated, but what are captures?
& What do you mean that m//g is a bug? I am quite a newbie...Thanks!
-Eric

Replies are listed 'Best First'.
Re^3: Simple (probably)
by ikegami (Patriarch) on Dec 13, 2009 at 05:37 UTC

    what are captures?

    The parens in
    if ('foo 123 bar' =~ /(\d+)/) { print("$1\n"); }
    123

    What do you mean that m//g is a bug?

    for (1..2) { if ('ab' =~ /a/g) { print("match\n"); } else { print("no match\n"); } }
    match no match
    for (1..2) { if ('ab' =~ /a/) { print("match\n"); } else { print("no match\n"); } }
    match match