Don't ask to ask, just ask | |
PerlMonks |
Re^3: regexp - replace spaces in quoted stringby uksza (Canon) |
on Sep 06, 2005 at 11:11 UTC ( [id://489436]=note: print w/replies, xml ) | Need Help?? |
Hm... Is it good explanation?? I'll try in my poor english: 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
In Section
Seekers of Perl Wisdom
|
|