in reply to Re: Reference to functions in CORE:: pseudo package?
in thread Reference to functions in CORE:: pseudo package?
Update: Zaxo's code does work, though I don't understand why. Perhaps something special about glob? Trying to override a different function works the way I recall:
$ # override in BEGIN block works $ perl -e'BEGIN { *CORE::GLOBAL::sin = sub { "a" } } print sin(0)' a $ # override at runtime doesn't have any effect $ perl -e'*CORE::GLOBAL::sin = sub { "a" }; print sin(0)' 0 $ # using local, still no effect $ perl -e'{ local *CORE::GLOBAL::sin = sub { "a" }; print sin(0) } pri +nt sin(0) ' 00
|
|---|