On 10/13/2006 07:57 AM, Luba Pardo wrote:
Dear sir/madam:
I am trying to write a script to process to consecutive lines at a time and
compare elements of between two consecutive lines.

I don't understand this sentence.


I tried something like:
$i=0;
while (<IN>){
chomp;
@a1_s= split/\</, $_{$I];
@a2_s= split/\</,$_[$i+1];

if ($a1_s[1] =~ /HG-Stats_gi1/){

@temp  = split/>/, $a1_s[1];
@temp1 = split/>/, $a2_s[1];

         print " line is $i, array is @a1_s, array 2 es @a2_s\n";
}
$i++;

}

close IN;

but it does not work. I guess the $_[$i] and $_[$i+1] does not work, but I
do not exactly how.


This is another slightly confusing sentence. I hope you mean that, using $_[$i] and $_[$i+1] does not work, and you don't know how to get it to work.

The answer would be to use Tie::File to make your file look like an array. If you are using ActiveState Perl on Windows, start a command
prompt and type "perldoc Tie::File"

Could anyone give any idea why?

Thanks in advance



Luba Pardo


You're welcome.



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


Reply via email to