use strict; use warnings; #use Bing::Translate; return sub { my( $said ) = @_; open(my $fh, "; chomp $secret; close($fh); my $tro = Bing::Translate->new($cid, $secret); if ($said->{body} =~ /^\s*(?\S+)\s+(?\S+)\s+(?.*)$/) { # print $secret; print $tro->translate($+{text}, $+{from}, $+{to}); } else { print "help text"; } return('handled'); } __DATA__ translate - Translate using the Bing Translation API.