#!/usr/bin/perl -w #filename: myMutator.pl use strict; my $file = shift || "myFiles/pi.txt"; open(FILE, "< $file") or die "Couldn't open $file: $!"; my @numberMutation; while () { chomp; push(@numberMutation, split(//, $_)); } my @organism = (1,1,1,1,1,1,1,1,1); foreach my $currentMutation (@numberMutation) { my $i = 0; foreach my $currentGene (@organism) { if ($currentGene < $currentMutation) { $organism[$i] = $currentMutation; $i++; } } } foreach my $someGene (@organism) { print "$someGene\n"; } foreach my $thisMutate (@numberMutation) { print "$thisMutate\n"; } #### chomp(my $line = ); my @numberMutation = split(//, $line);