For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > May 2006 > Works! - but warnings (was: replace string with variable)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Works! - but warnings (was: replace string with variable)
Mirco Wahab

2006-05-29, 8:03 am

Thus spoke Xicheng Jia (on 2006-05-29 14:48):

> $string =~ s/(?:\.0*|(\.\d*?)0+)(?=,|$)/$1/g;


my $text = qq{200.,0.00,200,200.000,99.0000002};
$text=~ s/(?:\.0*|(\.\d*?)0+)(?=,|$)/$1/xg;
print $text;

==> 200,0,200,200,99.0000002

OK but:
Use of uninitialized value in substitution iterator at regex2.pl line n.
Use of uninitialized value in substitution iterator at regex2.pl line n.
Use of uninitialized value in substitution iterator at regex2.pl line n.

Regards

Mirco

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com