Enable strict and warnings to make code easier to maintain and correctly write
Specify explicit filehandles for input and output

Otherwise the behaviour of <> is emulated which is not desirable since
@ARGV contains format names not filenames.  It also means one AlignIO
object is a writer instead of having two readers.
Switch from a while loop to a for loop

Some strange interaction with READLINE on the tied filehandle object
causes the topic ($_) to be "0" in the while loop but evaluate to true,
so it loops forever but is invalid input to $out.  This appears to be
the result of READLINE using a context dependent (wantarray) return
value and returning an array (which may be used in list or scalar
context).

Using for pre-calculates the entire list of alignments and then iterates
over them which avoids the buggy behaviour.

Another solution is:

    -print $out $_ while <$in>;
    +print $out $_ while $_ = scalar <$in>;

which forces scalar context for the implicit READLINE call.  Since the
condition is no longer in the form of while (<...>), explicitly setting
the topic is necessary.
Merge branch 'fixes-and-explanation' of https://github.com/tsibley/Bioperl_test