in reply to Efficient way to replace a set of values with another set of values
How about this:
$str = q{ 1. This is just a sample. 2. This is to check 3. How a set of values 4. can be replaced by another 5. set of values and that too 6. in the most efficient way. }; $str =~ s/^(\d)/chr($1+96)/meg; print $str; ### prints: a. This is just a sample. b. This is to check c. How a set of values d. can be replaced by another e. set of values and that too f. in the most efficient way.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Efficient way to replace a set of values with another set of values
by Arunbear (Prior) on Nov 23, 2012 at 10:48 UTC | |
by space_monk (Chaplain) on Nov 23, 2012 at 13:08 UTC | |
by roboticus (Chancellor) on Nov 23, 2012 at 14:57 UTC | |
by AnomalousMonk (Archbishop) on Nov 23, 2012 at 22:58 UTC | |
by ColonelPanic (Friar) on Nov 23, 2012 at 15:54 UTC | |
by tobyink (Canon) on Nov 23, 2012 at 16:00 UTC |
In Section
Seekers of Perl Wisdom