http://www.perlmonks.org?node_id=951965

jemswira has asked for the wisdom of the Perl Monks concerning the following question:

I have this project that's kinda urgent and I still have not much idea how to do it. What i'm supposed to do, is to take a file that looks like this:

# STOCKHOLM 1.0 #=GF ID 1-cysPrx_C #=GF AC PF10417.4 #=GF DE C-terminal domain of 1-Cys peroxiredoxin #=GF AU Finn RD, Coggill PC #=GF SE Gene3D, pdb_1prx ... #=GS A3EU39_9BACT/160-195 AC A3EU39.1 #=GS Q7VQB3_BLOFL/159-194 AC Q7VQB3.1 #=GS Q057V5_BUCCC/160-195 AC Q057V5.1 #=GS A5CDZ8_ORITB/160-195 AC A5CDZ8.1 ... // Similar set of data with different numbers.

so the final file i need is one with this:

A3EU39 | PF10417.4/ PF10000.3 Q7VQB3 | PF10417.4/...

I also have a file with a list of these 6digit numbers/letters and i have to arrange them in that order. At first i wanted to go through the file each time, but both files are large so i have to try and just run once through. So i was thinking a hash. like a hash with Q7VQB3->PF10417.4/.....

But to be honest, i have no idea how to. I'm sorry but i'm really new. i was thinking

my %hash; open PFAMDB, "C:\\Users\\Jems\\Desktop\\Perl\\Pfam-A.seed" or die $!; #thats the main file. while (my $pfam=<PFAMDB>){ my @units= split /#/,$pfam; if ($pfam=~ =GF AC){my $pf=$pfam;} if ($pfam=~ \sAC\s){if exists $hash{$pfam}{$hash{$pfam}=$pf} else .....

so this is where i get lost. can i push a new value to the end? also, will this work in the first place? Im sorry. but i'm still new D: please help me? Thanks!