bulk88 has asked for the wisdom of the Perl Monks concerning the following question:
I tried to override the builtin select with use subs 'select'; and then defining a 2nd select sub in the same package. I get a "Deep recursion on subroutine "IO::Select::Foo::select"" now (my custom select sub is overridden by the select method sub). How do I override the builtin select package wide and still keep my select method sub (which is public API and cant be renamed)?sub select { shift if defined $_[0] && !ref($_[0]); my($r,$w,$e,$t) = @_; my @result = (); my $rb = defined $r ? $r->[VEC_BITS] : undef; my $wb = defined $w ? $w->[VEC_BITS] : undef; my $eb = defined $e ? $e->[VEC_BITS] : undef; if(select($rb,$wb,$eb,$t) > 0) ################################################ }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: override CORE sub and keep method in same package
by BrowserUk (Patriarch) on Oct 14, 2013 at 20:53 UTC | |
by bulk88 (Priest) on Oct 14, 2013 at 23:35 UTC | |
by BrowserUk (Patriarch) on Oct 15, 2013 at 02:20 UTC | |
by bulk88 (Priest) on Oct 15, 2013 at 14:53 UTC | |
by BrowserUk (Patriarch) on Oct 15, 2013 at 23:01 UTC | |
|
Re: override CORE sub and keep method in same package
by LanX (Saint) on Oct 14, 2013 at 21:16 UTC | |
|
Re: override CORE sub and keep method in same package (another package)
by tye (Sage) on Oct 15, 2013 at 02:56 UTC | |
|
Re: override CORE sub and keep method in same package
by tobyink (Canon) on Oct 15, 2013 at 07:47 UTC |