BEGIN { *CORE::GLOBAL::sysread = sub (*\$$;$) { # whatever }; } #### { local *CORE::GLOBAL::sysread = \&mysysread; # do things that call builtin sysread } # no more replacement from here on