> My $string = ' 259.00 '; > > Note that I don't want to change the trailing space character. The > resulting string would look like: > > '00000259.00 ' > > The total length of the string would remain the same after the replace > operation. > > I'm just having a total brain-fade on this one.
$string =~ s/^(\s+)/'0' x length($1)/e Does that do what you want? P. ***************************************************************** Gloucester Research Limited believes the information provided herein is reliable. While every care has been taken to ensure accuracy, the information is furnished to the recipients with no warranty as to the completeness and accuracy of its contents and on condition that any errors or omissions shall not be made the basis for any claim, demand or cause for action. The information in this email is intended only for the named recipient. If you are not the intended recipient please notify us immediately and do not copy, distribute or take action based on this e-mail. Gloucester Research Limited, 5th Floor, Whittington House, 19-30 Alfred Place, London WC1E 7EA ***************************************************************** _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs