in reply to Replace a word in a line except for the last char of the word?
Hi try this,
$line = '<br> 2<br> 3<br> 4'; $line =~ s#(?= )# #gsi; while ($line =~ s#( ) ( )#$1$2#gsi) { } print $line; o/p: <br>   2<br>    3<br>    4
|
|---|