aristotle73 has asked for the wisdom of the Perl Monks concerning the following question:
UPDATE: Thx to everyone for all the help! It works now! :D Thx a bunches!!!! :D#!/usr/bin/perl -w #filename: myMutator.pl use strict; our (@organism,@numberMutation,$currentGene,$currentMutation,$someGene +,$thisMutate,$i); @organism = (1,1,1,1,1,1,1,1,1); open(FILE,"myFiles/pi.txt"); while (<FILE>) { chomp; @numberMutation = split(/\C/,$_); } foreach $currentMutation(@numberMutation) { $i = 0; foreach $currentGene(@organism) { if ($currentGene < $currentMutation) { $organism[$i] = $currentMutation; $i++; } } } foreach $someGene(@organism) { print "${someGene}\n"; } foreach $thisMutate(@numberMutation) { print "${thisMutate}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Arrays not being manipulated
by trammell (Priest) on Jan 01, 2005 at 04:59 UTC | |
by thor (Priest) on Jan 01, 2005 at 06:52 UTC | |
by holli (Abbot) on Jan 01, 2005 at 11:29 UTC | |
by thor (Priest) on Jan 01, 2005 at 15:05 UTC | |
by trammell (Priest) on Jan 01, 2005 at 15:53 UTC | |
|
Re: Arrays not being manipulated
by William G. Davis (Friar) on Jan 01, 2005 at 06:59 UTC | |
by aristotle73 (Sexton) on Jan 01, 2005 at 08:20 UTC | |
by William G. Davis (Friar) on Jan 01, 2005 at 08:47 UTC | |
by trammell (Priest) on Jan 01, 2005 at 19:37 UTC | |
|
Re: Arrays not being manipulated
by nedals (Deacon) on Jan 01, 2005 at 20:08 UTC | |
by aristotle73 (Sexton) on Jan 01, 2005 at 20:29 UTC | |
by nedals (Deacon) on Jan 01, 2005 at 21:05 UTC | |
by aristotle73 (Sexton) on Jan 01, 2005 at 21:40 UTC |