Following this example,

I tried to override print with my own:

BEGIN {*CORE::GLOBAL::print = sub {print 1};}
print 2;

But it turns out that it doesn't work,2 is still printed instead of 1.

Why?

Edit
Report