in reply to overwrite builtin functions ( system, chdir )

Would something like this do?
use subs 'system','chdir','glob'; glob; chdir; system; sub system {print "system\n"} sub chdir { print "chdir\n" } sub glob { print "glob\n" }

__OUTPUT__

glob
chdir
system

Replies are listed 'Best First'.
Re^2: overwrite builtin functions ( system, chdir )
by borisz (Canon) on Apr 04, 2005 at 13:33 UTC
    Hi,
    No, that is not enough, I like to overwrite the functions global regardless of the namespace.
    So that this work:
    *CORE::GLOBAL::system = sub { print "system\n" }; *CORE::GLOBAL::chdir = sub { print "chdir\n" }; *CORE::GLOBAL::glob = sub { print "glob\n" }; package xyz; glob; chdir; system
    Boris