… | |
… | |
33 | use Coro; |
33 | use Coro; |
34 | use Coro::Event; |
34 | use Coro::Event; |
35 | |
35 | |
36 | use base Exporter::; |
36 | use base Exporter::; |
37 | |
37 | |
38 | our $VERSION = 1.9; |
38 | our $VERSION = 2.0; |
39 | our @EXPORT_OK = "select"; |
39 | our @EXPORT_OK = "select"; |
40 | |
40 | |
41 | sub import { |
41 | sub import { |
42 | my $pkg = shift; |
42 | my $pkg = shift; |
43 | if (@_) { |
43 | if (@_) { |
… | |
… | |
51 | if (@_ == 0) { |
51 | if (@_ == 0) { |
52 | return CORE::select; |
52 | return CORE::select; |
53 | } elsif (@_ == 1) { |
53 | } elsif (@_ == 1) { |
54 | return CORE::select $_[0]; |
54 | return CORE::select $_[0]; |
55 | } elsif (defined $_[3] && !$_[3]) { |
55 | } elsif (defined $_[3] && !$_[3]) { |
56 | return CORE::select (@_); |
56 | return &CORE::select (@_); |
57 | } else { |
57 | } else { |
58 | my $current = $Coro::current; |
58 | my $current = $Coro::current; |
59 | my $nfound = 0; |
59 | my $nfound = 0; |
60 | my @w; |
60 | my @w; |
61 | for ([0, 'r'], [1, 'w'], [2, 'e']) { |
61 | for ([0, 'r'], [1, 'w'], [2, 'e']) { |