GertMT has asked for the wisdom of the Perl Monks concerning the following question:
Thanks for any reply#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use Data::Table; my $table = new Data::Table( [ [ "100,20", "18,20", "19,45", "7,25" ], [ "2", "3", "2", "2" ],[ +0,0,0,0] ], [ 'Numbers', 'Values' , 'Result'], 1 ); $table->colsMap( sub { $_->[2] = ($_->[0] =~ s/,/\./g) * $_->[1] } ); print $table->csv;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: replace comma for dot re. calculation
by GrandFather (Saint) on Jun 22, 2007 at 09:45 UTC | |
by GertMT (Hermit) on Jun 22, 2007 at 10:01 UTC |