s/(".*?")/($x=$1)=~y: :_:, $x/ge)
[CUT]
=~y: :_:, '=~y: :_:, '
----------------------------------------------------------------------
$ before an optional \n, and the end of the
string
----------------------------------------------------------------------
x/ge 'x/ge'
Hm... Is it good explanation??
I'll try in my poor english:
s/(".*?")/($x=$1)=~y: :_:, $x/ge)
^^^^^^^^^1
^^^^^^^2
^^^^^^^3
^^4
^^^5
1) take ALL between " and "
2) So you have ALL in $1. $1 is read only, so copy $1 to $x. And now, for one moment forget about all and work only on $x (this is thanx /e which "wraps an eval{...} around the replacement string and the evaluated result is substituted for the matched substring".
3)in $x replace all ' ' to '_'
4)put replaced $x into first s/from/to/
5)g - works globaly; e - eval the replacment string
greets
Uksza |