Oh! Good to know, thanks so much. That'll be so useful for the future. And no, you're right, I don't want to push the $i-file repeatedly, that was a mistake.
Thank you so much!
There is something strange happening though, I think it's because there is something wrong in this bit
for ($i=1; $i<=3; $i++) {
open $input1, '<', "$path\/File-$molec1-cluster$i.out" or die $!;
push @ARGV, "$path\/File-$molec1-cluster$i.out";
for ($j=2; $j<=3; $j++) {
open $input2, '<', "$path\/File-$molec2-cluster$j.out" or die $!;
push @ARGV, "$path\/File-$molec2-cluster$j.out";
When I print the contents of the files, the result is completely chaotic. I would expect the printing to be sequential like so
1st print file molec1-$i=1
2nd print file molec1-$i=2
3rd print file molec1-$i=3
4th print file molec2-$j=2
5th print file molec2-$j=3
but in my case the end result is a combination of $i-file with only the second option of $j-file repeated ($j=3), while the $j=2 is completely ignored.
What i'm getting is:
1st print file molec1-$i=1
2nd print file molec2-$j=3
3rd print file molec1-$i=2
4th print file molec2-$j=3 (repeat)
5th print file molec1-$i=3
6th print file molec2-$j=3 (repeat)
I don't understand why this pattern appears...?
|