in reply to Using SprintF in S & R
Howdy!
The right hand side of s/// does not execute code unless you use the "e" modifier.
So, s/\<time\>(\d+)\<\/time\>/\<time\>sprintf("%06d",$1)\<\/time\>/e is what you want. Note the "e" after the last slash.
Edit to correct placement of "e" modifier. Thanks Laurent. Too many slashes and backslashes!
yours,
Michael
Michael
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using SprintF in S & R
by afoken (Chancellor) on Jul 11, 2017 at 20:37 UTC | |
Re^2: Using SprintF in S & R
by Laurent_R (Canon) on Jul 11, 2017 at 19:00 UTC | |
by herveus (Prior) on Jul 11, 2017 at 19:25 UTC |
In Section
Seekers of Perl Wisdom