package Processor; use Lingua::StanfordCoreNLP; use strict; use warnings; use Class::MakeMethods ( 'Template::Hash:scalar' => [ 'text', ], 'Template::Hash:object' => [ { name=> 'results', class=> 'Lingua::StanfordCoreNLP::PipelineSentenceList' }, ], 'Standard::Global:object' => { name => 'pipeline', class => 'Lingua::StanfordCoreNLP::Pipeline', }, ); my $pipeline = new Lingua::StanfordCoreNLP::Pipeline(1, 1); Processor->pipeline( $pipeline ); sub new { my $callee = shift; my $package = ref $callee || $callee; my $self = shift; bless $self, $package; return $self; } sub process_text { my ($self,$text) = @_; $self->text( $text ) if $text; $self->results( $self->pipeline->process( $self->text ) ); } 1; #### Can't locate object method "new" via package "Lingua::StanfordCoreNLP::Pipeline" (perhaps you forgot to load "Lingua::StanfordCoreNLP::Pipeline"?)