shaludr has asked for the wisdom of the Perl Monks concerning the following question:
I have a tab delimited file and I want to multiply each value in the file with 50 and the user input value ($df). My code is giving me following error :
Argument "6 20 40 " isn't numeric in multiplication (*) at - line 9, <FILE> line 3.
use warnings; print " Enter the dilution factor. \n"; chomp ($df = <STDIN>); open FILE, "45well.txt" or die $!; while (<FILE>){ chomp $_; @values = split('\t', $_); $val = @values; foreach $val (@values){ $DNA_conc = $val * $df * 50 ; print $DNA_conc; print"\n"; } } close (FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: handling tab delimited files
by almut (Canon) on May 05, 2010 at 16:52 UTC | |
by shaludr (Initiate) on May 05, 2010 at 17:00 UTC | |
by almut (Canon) on May 05, 2010 at 17:21 UTC | |
by shaludr (Initiate) on May 05, 2010 at 17:40 UTC | |
by almut (Canon) on May 05, 2010 at 17:47 UTC | |
| |
by shaludr (Initiate) on May 05, 2010 at 17:53 UTC | |
| |
|
Re: handling tab delimited files
by toolic (Bishop) on May 05, 2010 at 16:52 UTC | |
by shaludr (Initiate) on May 05, 2010 at 17:05 UTC | |
by toolic (Bishop) on May 05, 2010 at 17:30 UTC |