Austin Hastings pondered:
my $outfh = all(@input_handles);
while (<$outfh>) print;
No. Apart from the bug (leaving off the braces around the C<print>...spot
the C hacker! ;-), this reads from each of the @input_handles and returns
a conjunction of the values that were read. The print then serializes the
conjunction and prints it. But serialization of a conjunction probably
involves putting an "all(...)" around its states.
You'd get *closer* to the desired behaviour with:
my $outfh = any(@input_handles);
while <$outfh> { print; }
because the serialization of a disjunction is just the list of
states. However, junctions don't guarantee the order of their
states so your interleaving might be messed up. Moreover, they
*do* guarantee uniqueness of their states, so any lines that
happened to be identical in two or more files would appear only
once. :-(
What you want here is probably just:
print zip �readline� @input_handles;
> Do junctions know about the origins of their components?
No.
Is "preserving order" a meaningful concept?
No.
(Especially in light of entanglement, which will require origin
> info if it is to be added as an external module.)
Junctions aren't quantum mechanical, so this doesn't apply.
Damian