http://www.perlmonks.org?node_id=852562


in reply to Re^2: Change decimal point temporarily
in thread Change decimal point temporarily

use Scalar::Util qw( looks_like_number ); my $s = 123.45; $s =~ s/\./,/ if looks_like_number($s);

Works even better than setlocale because you are surely starting with the number in string form if you don't know whether a column contains a number or not.