Use the following script in a pipe, like this: perl persmorphb.pl wordformlistfilename > resultsfilename-json
#!/usr/bin/perl -w # persmorphb.pl - sends a list of words to Bamboo/Morpheus morphology service # usage: perl persmorphb.pl filename use strict; use warnings; require LWP::UserAgent; my $addr2 = "http://services-qa.projectbamboo.org/bsp/morphologyservice/analysis/word?lang=lat&engine=morpheus&word="; my $verbum; my $file = $ARGV[0]; open(STDIN, '<:encoding(utf8)', $file) or die "Could not open '$file' $!\n"; while ($verbum = <STDIN>) { chomp $verbum; &uag(); } sub uag { my $ua = LWP::UserAgent->new; $ua->timeout(30); $ua->env_proxy; my $response = $ua->get($addr2 . $verbum); if ($response->is_success) { my $content = $response->decoded_content(); if (utf8::is_utf8($content)) { binmode STDOUT,':utf8'; } else { binmode STDOUT,':raw'; } print $content; # print $response->content( ); # or whatever print ",\n"; } else { die $response->status_line; } }