in reply to Re^2: Output minimal occurrences of matching regex(es)
in thread Output minimal occurrences of matching regex(es)

I've got two issues:

Actually, you have only one issue with 2 symptoms. Both symptoms are because you are not capturing the results of the match. Use brackets to do that. eg:

$ perl -we '$regex = qr/foo/; print "$regex: $1\n" while "foob" =~ /$r +egex/g;' Use of uninitialized value $1 in concatenation (.) or string at -e lin +e 1. (?^:foo): $ perl -we '$regex = qr/(foo)/; print "$regex: $1\n" while "foob" =~ / +$regex/g;' (?^:(foo)): foo $

🦛