in reply to Re: Printing with Indirect FileHandles
in thread Printing with Indirect FileHandles

except that your last example demonstrates that it does not behave exactly as print says it does.

How so?

In print {$output} $_, nothing is omitted, so what is specified to print is printed to the specified handle.

In print $output $_, nothing is omitted, so what is specified to print is printed to the specified handle.

In print $output, the file handle is omitted, so $output is printed to the currently selected handle.

And the first, print {$output}, is not one of the valid forms.

Replies are listed 'Best First'.
Re^3: Printing with Indirect FileHandles
by ig (Vicar) on Aug 26, 2009 at 01:03 UTC

    In print OUTPUT while (<$input>); a file handle is given but no list. print doesn't even admit in the synopsis that such a case is possible and it says:

    If LIST is also omitted, prints $_ to the currently selected output channel.

    My emphasis.

      oh, I missed that one.
Re^3: Printing with Indirect FileHandles
by bichonfrise74 (Vicar) on Aug 26, 2009 at 04:13 UTC
    Thanks. And what is the explanation as to why print OUTPUT works?