sokatron has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; my ($antal); my ($size); print "How many replicates? "; $antal = <stdin>; print "How many Samples? "; $size = <stdin>; my ($tam); my ($tim); $tim = 0; my ($x); my (@a); my ($repvalue); my ($repvalue2); $repvalue2 = 1; for ($x=0; $x<$size; $x++) #For each Sample the number of replicat +es are entered { for ($tam=0; $tam<$antal; $tam++ ) #For each replicate in the +sample a value is added { $repvalue = $tam+1; print "Imput replicate value $repvalue for sample $repvalu +e2: "; $a[$tim][$tam] = <stdin>; } $repvalue2++; $tim++; print "\n"; } my ($n); my ($m); my ($n2); my ($m2); for ($n = 0; $n<$size; $n++) #For printing and checking all values { print "\n\n"; $n2 = $n+1; print "Replicates of sample $n2:\n\n"; for ($m=0; $m<$antal; $m++) { $m2 = $m+1; print "Replicate $m2 value is: $a[$n][$m]"; } print "\n\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting out an array within an array
by locked_user sundialsvc4 (Abbot) on Oct 01, 2012 at 20:03 UTC | |
by Anonymous Monk on Oct 02, 2012 at 06:18 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 20, 2012 at 05:34 UTC | |
by sokatron (Initiate) on Oct 02, 2012 at 06:37 UTC | |
|
Re: Getting out an array within an array
by Kenosis (Priest) on Oct 01, 2012 at 20:47 UTC | |
by sokatron (Initiate) on Oct 02, 2012 at 06:45 UTC | |
|
Re: Getting out an array within an array
by Lotus1 (Vicar) on Oct 01, 2012 at 20:50 UTC | |
by sokatron (Initiate) on Oct 02, 2012 at 06:52 UTC |