Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: loop issue...

by bellaire (Hermit)
on Mar 20, 2009 at 14:40 UTC ( [id://752057]=note: print w/replies, xml ) Need Help??


in reply to loop issue...

Well, here you check whether this particular file is one of the four you want:
for my $f(@files){ if($f=~ m%^(\d*)(HU.fa|HD.fa|Ltvec_small.FA|_fasta)$%) {
But on the very next line, you decide to process all of them:
my ($fa, $hu, $hd, $lt)= ($1."_fasta", $1."HU.fa", $1."HD.fa", $1."Ltv +ec_small.FA");
So each time your code hits HU.fa, it'll process all the files. Then when it hits HD.fa, it'll process them all again. Same for the other two. That's why you see the output 4x.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-24 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found