#!/usr/bin/env perl use Lingua::EN::Tagger qw(add_tags); my $postagger = new Lingua::EN::Tagger; my $file = "test.txt"; my $text = do { local $/ = undef; open my $fh, "<", $file or die "could not open $file: $!"; <$fh>; }; my $tagged = $postagger->add_tags($text); print $tagged, "\n";