Can't locate object method "edit" via package "IO::File" at searchandreplace.pl line 65 (#1) (F) You called a method correctly, and it correctly indicated a package functioning as a class, but that package doesn't define that particular method, nor does any of its base classes. See perlobj.