in reply to Re^2: sub STDERR { *STDERR } -- nearly works !
in thread sub STDERR { *STDERR } -- nearly works !

*STDERR is already a perfectly fine first class variable. No need to duplicate it as $STDERR.

It's especially curious that you point out that a STDERR function would be even better in the last paragraph, contradicting the rest of your post (which argues for conformity with other file handles).

Replies are listed 'Best First'.
Re^4: sub STDERR { *STDERR } -- nearly works !
by gone2015 (Deacon) on Apr 09, 2008 at 10:07 UTC

    Up to a point... print *FH .... causes Perl to throw up, where print $FH .... doesn't.

    It appears that a $STDERR is more general.

    Well, yes, I put my hand up on the inconsistency. But, declaring $STDERR and exporting it to everywhere it's used is a bit ugly.

    ...but brother ysth points out the error in my thinking, $STDERR does need to be exported after all. So I don't need the sub trick after all.