Yes, it has to be imported from another package to override. That's what subs is for.
$ perl -e' sub readpipe { die }; readpipe("ls"); ' $ perl -e' use subs qw( readpipe ); sub readpipe { die } readpipe("ls"); ' Died at -e line 3.
In reply to Re: Overriding built-in function works only via import()?
by ikegami
in thread Overriding built-in function works only via import()?
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |