On 24 Jul 2001, at 15:35, Wagner-David wrote:

> Do you have what data looks like or some code? It is unclear to me
> what you are doing with the ZyX test.
> 
> Wags ;)

I'm hoping to match /ZyX/ once only push it into @newarray.
Then repeat: match /AbC/; match /ZyX/ once only ...
Then repeat: match /AbC/; match /ZyX/ once only ...etc ...

I have some code, but I don't think it will help .. I understand 
what I want, I just can't figure it out. 

#!/usr/bin/perl
print "Content-type: text/html\n\n";

open(INF,"textfile.txt") or dienice("Couldn't open textfile.txt
for
reading: $! \n");
@data = <INF>;
close(INF);

         
        $length = @data;
        print $length;
        print "length";

##### This is very crude and dirty. But I gotta start somewhere ....
##### This doesn't work, it keeps matching ZyX every time it sees 
##### ZyX. I only 
##### want it to match ZyX once and then match AbC and then 
##### match ZyX once only again.
##### And then repeat match AbC, match ZyX once; repeat match 
##### AbC, match ZyX once; etc ..

         for ($z = 0; $z < $length; ++$z) {
                 
         print "<br>";
         print "beginning of stuff";
         print $z;
         print "<br>";
         
         @revstuff = reverse(@data);


         $stuff = $revstuff[$z];


           if ($stuff =~/AbC/){

               print " ****** match AbC****** ";

               push(@iof_partnum, $stuff);
}

                   if (@iof_partnum[0] =~/AbC/){

                      if ($stuff =~/ZyX/){
                
                         print " !!!!!!! match ZyX !!!!!!! ";
                                   push(@iof_partnum, $stuff);
}
}

             if ((@iof_partnum[0] =~/AbC/) && ($stuff =~/ZyX/)) {

                  print " 111111111 BOTH MATCH 999999999 ";

                     if ($stuff =~/AbC/){

                           print " ****** 2nd match AbC****** ";

                                   push(@iof_partnum, $stuff);

}
}

            if (@iof_partnum[2] =~/AbC/){

                      if ($stuff =~/ZyX/){
                
                         print " !!!!!!! 2nd match ZyX !!!!!!! ";

}
}




         #$stuff=$data[$z];
         print $stuff;
         print "<br>";
         print "equals stuff";
         print "<br>";

         
}
                 


        $length = @iof_partnum;
        print $length;
        print "length";



         for ($z = 0; $z < $length; ++$z) {
                 
         print "<br>";
         print "beginning of stuff";
         print $z;
         print "<br>";

         $stuff=$iof_partnum[$z];
         print $stuff;
         print "<br>";
         print "equals stuff";
         print "<br>";

} 




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to