Thread uninitialized value in regex (12 answers)
Opened by esskar at 2010-03-25 12:48

esskar
 2010-03-25 12:48
#135280 #135280
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
sub convert_to_float {
        my ( $number ) = @_;
        $number = sprintf '%.02f', $number || 0;
        $number =~ s/.(\d*[1-9])?0*\z/,$1/;
        return $number;
}
convert_to_float(1);
__END__
Use of uninitialized value $1 in concatenation (.) or string

wie bekomm ich denn geschickt die warnung weg?

View full thread uninitialized value in regex