#!/usr/bin/perl -- BEGIN { package OOO; sub new { my( $pkg, $path ) = @_; bless \$path, $pkg; } sub filetest { warn "its fake @_\n"; 'fake' } use overload '-X' => \&filetest; $INC{'OOO.pm'} = __FILE__; } use strict; use warnings; use OOO; -f OOO->new('.'); __END__ Operation """": no method found, argument in overloaded package OOO at - line 6.