Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(MeowChow) Re: How to control the loop

by MeowChow (Vicar)
on May 30, 2002 at 01:04 UTC ( #170270=note: print w/ replies, xml ) Need Help??


in reply to How to control the loop

I'm guessing you meant to do something like:
  
#!/usr/bin/perl -w use strict; open(FH, "table") or die "Can't open file to read!: $!\n"; for my $i (2..682) { while (<FH>) { chomp; my @matrix = split; my $seed = $matrix[$i]; if ($seed !~ /[ACGTN-]/) { print "P$i "; last; } } seek FH, 0, 0; } close FH;
This code assumes your file is too large to reasonably read into an array; if not, you should do so, instead of reading it over and over 682 times. Even if it is quite large, there are better ways to process it, if efficiency is of any concern.

   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on (MeowChow) Re: How to control the loop
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://170270]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-08-23 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls