You want to replace a standard, built-in function with your own version.
Import that function from another module into your own namespace.
Many (but not all) of Perl’s built-in functions may be overridden. This is not something to be attempted lightly, but it is possible. You might do this, for example, if you are running on a platform that doesn’t support the function that you’d like to emulate. Or, you might want to add your own wrapper around the built-in.
Not all reserved words have the same status. Those that return a
negative number in the C-language
function in the toke.c file in your Perl source
kit may be overridden. Keywords that cannot be overridden as of 5.004
y. The rest can.
A standard Perl module that does this is Cwd, which can overload
chdir. Others are the by-name versions of the
functions returning lists: File::stat, Net::hostent, Net::netent,
Net::protoent, Net::servent, Time::gmtime, Time::localtime, Time::tm,
User::grent, and User::pwent. These modules all override built-in
getpwnam to return an object that can be accessed ...