in reply to Re: What does 'global' (/g) do in a regexp in this particular case?
in thread What does 'global' (/g) do in a regexp in this particular case?

> As a workaround

ehm, ok! But what for???

Can't see any benefit of using /g here.

Cheers Rolf

( addicted to the Perl Programming Language)

Update

OK at least in a loop pos works on literals...

DB<139> print scalar "a a" =~ /a/g for 1..10 1111111 # third iteration is undef than restart from beginning DB<140> print scalar "a a" =~ /a/ for 1..10 1111111111 # infinite restart
  • Comment on Re^2: What does 'global' (/g) do in a regexp in this particular case?
  • Download Code