select() sometimes returns invalid string
authorFather Chrysostomos <sprout@cpan.org>
Sun, 25 Dec 2011 07:27:30 +0000 (23:27 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 25 Dec 2011 07:31:35 +0000 (23:31 -0800)
commit204263bc1eb63f1dfd6180c05dca8cec2c319504
treecaf6a3d6d37d16d94ed06f33320b39ba4b5d209b
parent01e8a1a6f52deee45aadeddbd49c199f4048b262
select() sometimes returns invalid string

The return value from select() is sometimes a string, and sometimes a
globref.  It was originally always a string, but typeglobs not to be
found under their names in their stashes started being returned as
references in 5.002 beta 1 (4633a7c4b).  The logic is a little faulty,
though, as sometimes the name that is returned cannot be used to find
the glob:

$ perl -le '
    open "foo::bar", ">/dev/ttys009";
    select foo::bar;
    my $handle = \*foo::bar;
    my $stash = \%foo::bar;
    *foo:: = *bar::;
    print "hello";
    select select;
    print "hello" or warn $!
'
Bad file descriptor at -e line 9.

In this example, /dev/ttys009 is another terminal window.  "hello"
only appears once, not twice.
pp_sys.c
t/op/select.t