develooper Front page | perl.perl5.porters | Postings from January 2021

is -t *STDOUT{IO} broken?

From:
Eric Wong
Date:
January 9, 2021 03:24
Subject:
is -t *STDOUT{IO} broken?
Message ID:
X/kgIqIuh4ZtUZNR@dcvr
Hey all, not sure if this is a bug or intended behavior.

"-t *STDOUT{GLOB}" and "-t fileno(*STDOUT{IO})" but work as expected,
but "-t *STDOUT{IO}" doesn't.

# the following works as expected from a terminal:
$ perl -Mstrict -w -E 'say -t *STDOUT{GLOB}'
1
$ perl -Mstrict -w -E 'say -t fileno(*STDOUT{IO})'
1

# from the same terminal:
$ perl -Mstrict -w -E 'say -t *STDOUT{IO}'
Use of uninitialized value in say at -e line 1.

Fwiw, I still find IO vs GLOB confusing despite reading perlref
manpage for decades :x

Happens on Perl 5.32 (FreeBSD 11) and 5.28.1 (Debian 10 buster)
Thanks in advance for any response you provide.

(I can't use GitHub due to Terms-of-Service + JS + CAPTCHA requirement)



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About