Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: What does 'global' (/g) do in a regexp in this particular case?

by Anonymous Monk
on Apr 09, 2013 at 13:52 UTC ( #1027744=note: print w/replies, xml ) Need Help??


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?

$Column is already a different string, DreamT has tripped /g in list context bug -- interpolation breaks aliasing/ causes copying -- jumps out of the bug
  • Comment on Re^2: What does 'global' (/g) do in a regexp in this particular case?

Replies are listed 'Best First'.
Re^3: What does 'global' (/g) do in a regexp in this particular case?
by choroba (Chancellor) on Apr 09, 2013 at 13:56 UTC
    Where is the list context?
    perl -E '$x = "12345"; $a = $x =~ /4/g; $b = $x =~ /1/g; say "$a,$b.\n +"'
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027744]
help
Chatterbox?
[stevieb]: cheers beech. twas totally my mistake, and I got bit. When things work for so long without issue, one becomes complacent (ie. replace we/one with I ;) I've been copy/pasting that around for a few years without a hiccup, so when...
[stevieb]: choroba pointed that out, I was just, you know, *sigh*. In effect, I was lucky and fortunate
[stevieb]: Kind of like my regex-fu went out the window, but only while looking at that specific file ;)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-07-25 23:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (383 votes). Check out past polls.