Hi, all:
I have a simple work task: input from keyboard a name with two values(its concentration and volume) and then print out a table that shows list of names with their concentration, volume, total yield(con*vol), how much for 30ug/50ug(30/concentration).
I don't know how to create a hash with two values from STDIN, and here is the one I put those in the program.
Many thanks.#!/user/bin/perl # RNAi_cal.plx use warnings; #use strict; my $yield; my $thirty_ug; my $fifty_ug; #my %RNA; #print "Please enter RNAi name, concentration:\n"; my %RNA=( Ash2 =>"1.85", Ja2_1 =>"1.89", Ja2_2 =>"2.49", Set1_1 =>"1.55", Set1_2 =>"2.88"); my %vol=( Ash2 =>"150", Ja2_1 =>"150", Ja2_2 =>"100", Set1_1 =>"150", Set1_2 =>"100"); print "\t Con\.\t Volume\t Total yield (ug)\t 30ug\t 50ug\t \n"; for (keys %RNA){ $yield=$RNA{$_}*$vol{$_}; $thirty_ug=int(30/$RNA{$_}*100)/100; $fifty_ug=int(50/$RNA{$_}*100)/100; print "$_\t $RNA{$_}\t$vol{$_}\t $yield\t \t\t$thirty_ug\t $fifty_ +ug\t \n"; }
In reply to a simple work task by polycomb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |