On Sat, 23 Feb 2010, Jakub Narebski wrote:
This means replacing
print <something>;
by
print {$out} <something>;
and
binmode STDOUT, <layer>;
by
binmode $out, <layer>;
[...]
This patch was written _before_ comment from Junio that it would be
better to simply use
print $out <something>;
and do not try to be too clever.
Actually 'print FILEHANDLE LIST' form is an example of indirect object
syntax in Perl (which for filehandles was present before there were
objects in Perl). In indirect object notation the "first argument"
must be a name, a scalar variable, or a block (like {$out}). If instead
of $out there would be something more complicated, we would have to
use block form ('print {$out[$i]} <sth>', for example).
--
Jakub Narebski
Poland