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

is -t *STDOUT{IO} broken?

Eric Wong
January 9, 2021 03:24
is -t *STDOUT{IO} broken?
Message ID:
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}'
$ perl -Mstrict -w -E 'say -t fileno(*STDOUT{IO})'

# 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) Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About