in reply to 'g' flag w/'qr'
The /g variants are for repetitive matches / looping !
It's comparable to switching between if and while , which are obviously different beasts.
If you look at other languages like eg javascript¹ you'll notice that they are implemented using different keywords.
( I wished the perldocs were clearer here because it's causing confusion)
Furthermore are regular expressions meant to be combinable/nestable , but a sub expression with /g doesn't make any sense.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
¹) couldn't reproduce this easily, JS is very close to Perl in many aspects,
I had probably another language in mind... Python, PHP?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 'g' flag with 'qr' (different commands) (updated)
by perl-diddler (Chaplain) on May 30, 2016 at 01:47 UTC | |
by AnomalousMonk (Archbishop) on May 30, 2016 at 04:01 UTC | |
by LanX (Saint) on May 30, 2016 at 11:13 UTC |