#!/usr/bin/perl use strict; use warnings; use lib qw(lib); use TestExporter; my $obj = TestExporter->new; if ( $obj->can( 'readfile' ) ) { my @lines = $obj->readfile({ file => $0 }); print @lines; }