Thanks a lot. I think I am all set. I used the code drafted by Dermot. And Shawn , Thanks a lot for your advise.
-Minky On Tue, Sep 30, 2008 at 9:28 AM, minky arora <[EMAIL PROTECTED]> wrote: > > Hi All, > > I am not really new to perl but still find myself struggling with it. I > have a very simple problem in front of me, but am unable to slove it. > > Here is the problem: > I have a file with lines like FF3M62TC02 AGGCAT-GGATG-ACAGT > > There are multiple lines like this. ALl I have to do it have the user enter > a unique identiofier (FF3M62TC02 in this case) and then have the script > pull out the pattern following the identifier. (AGGCAT-GGATG-ACAGT in this > case). The alphabets and '-' can be different for diff idnetifiers, hence > this pattern can vary slightly but overall it only has a combination og > alphabets and hypens. > > Here is my code so far. I am unable to bring all pieces together. I need to > automate it so user can keep entering identifiers (as many as he wants) but > I am lost. PLease help. > > > #!/usr/local/bin/perl > $file = '/me/assembly; > open(INFO, $file); # Open the file > @lines = <INFO>; > > foreach $lines(@lines){ > if $line = /^FF3M6TC02/ > { > print $lines"; > }else > {print "not found"; > }} > > > close(INFO); # Close the fileprint @lines; >