Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks
I am having a problem with the following bit of code. It will only print the first sequence and then seems to stop.
I want it to print the correct number of sequences and then push them onto an array
Here is the code I have so far
$number_of_sequences=12; $max_length=50; $min_length=30; for ($i=0; $i < $number_of_sequences;) { $aminoseq = genseq($aminoseq); print "$aminoseq\n\n"; push (@set,$aminoseq); } sub genseq { $leg=randomlength(); for ($i=0; $i<$leg; $i++) { $seq.=randomaminoacid(); } return $seq; }
Thanks for your help in advance a newbie
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Running a subroutine a certain number of times
by dreadpiratepeter (Priest) on Aug 05, 2002 at 14:29 UTC | |
by davorg (Chancellor) on Aug 05, 2002 at 15:11 UTC | |
by dreadpiratepeter (Priest) on Aug 05, 2002 at 15:34 UTC | |
|
Re: Running a subroutine a certain number of times
by Abigail-II (Bishop) on Aug 05, 2002 at 14:26 UTC | |
|
please, PLEASE use strict!
by flocto (Pilgrim) on Aug 05, 2002 at 14:25 UTC | |
by Abigail-II (Bishop) on Aug 05, 2002 at 14:30 UTC | |
by dreadpiratepeter (Priest) on Aug 05, 2002 at 14:45 UTC | |
by flocto (Pilgrim) on Aug 05, 2002 at 15:04 UTC |