Hi,
    I am learning to print two arrays in a single file but unable to
do. So, I am printing it in two files. Any ideas

# Populating the arrays @alphaid and @betaid
foreach my $line (@File1)
     {
        if ($line =~ /^AC/)
          {
            $line =~ s/^AC\s*//;
              @alphaid = $line;
              push(@alphaid,$_);
          }

        if ($line =~ /^DR/)
           {
            $line =~ s/^DR\s*//;
              @betaid = $line;
              push(@betaid,$_);
           }
     }

#Printing the arrays in two files. Here I would like to have them in a
single with tab character separating the #arrays such as
# alphaid[1] \t  betaid[1]
# alphaid[1] \t  betaid[2]
# and so on

         foreach $alphaid (@alphaid)
              {
              open (MYFILEG, '>>f1.txt');
              print MYFILEG @alpha;
              close (MYFILEG);
               }

        foreach $betaid (@betaid)
             {
              open (MYFILEE, '>>f2.txt');
              print MYFILEE @betaid;
              close (MYFILEE);
           }

any help will be appreciated.
-K


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to