in reply to Re^2: Overriding built-in function works only via import()?
in thread Overriding built-in function works only via import()?

Consequently it shouldn't work if the import() is called in the same package, right? (Untested)

Yep, looks like it:

$ perl -wle '{ package Foo; sub import { *{caller."::readpipe"} = sub {"Foo"} } } BEGIN { Foo->import() } print `xyz`' Foo $ perl -wle 'sub import { *{caller."::readpipe"} = sub {"Foo"} } BEGIN { main->import() } print `xyz`' Can't exec "xyz": No such file or directory at -e line 2.