diff options
| author | Obfuscoder | 2014-10-17 22:54:13 +0200 |
|---|---|---|
| committer | Obfuscoder | 2014-10-19 10:28:41 +0200 |
| commit | d84f1e1808b3252af83e4963eccfd1e4f19c5326 (patch) | |
| tree | 18b64164a95e6ba73e50d4ce9938e9760ad8a217 /scripts/eng_no_translate_dpryo.pl | |
| parent | 263a56d196da657b72ccf2b195b50008d6a988dc (diff) | |
| download | scripts.irssi.org-d84f1e1808b3252af83e4963eccfd1e4f19c5326.tar.bz2 | |
Fix perlcritic issues for all scripts starting with e to l
Diffstat (limited to 'scripts/eng_no_translate_dpryo.pl')
| -rw-r--r-- | scripts/eng_no_translate_dpryo.pl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/eng_no_translate_dpryo.pl b/scripts/eng_no_translate_dpryo.pl index f00f40c..63dc8b4 100644 --- a/scripts/eng_no_translate_dpryo.pl +++ b/scripts/eng_no_translate_dpryo.pl @@ -20,10 +20,11 @@ # guys are calling their software when it's in a buggy and # not-so-very-usefull stage of development :P # +use strict; use Irssi; use LWP::Simple; use vars qw($VERSION %IRSSI); -$translate =0; +my $translate =0; $VERSION = "0.2"; %IRSSI = ( @@ -37,20 +38,20 @@ $VERSION = "0.2"; ); sub income { -my ($server, $data, $nick, $mask, $target) = @_; - $eng = $data; - if($translate=1) { + my ($server, $data, $nick, $mask, $target) = @_; + my $eng = $data; + if($translate) { $eng =~ s/ /+/ig; chop($eng); Irssi::command("/echo [$nick] $eng"); - $result = get("http://ets.freetranslation.com:5081/?Sequence=core&Mode=txt&template=TextResults2.htm&Language=English/Norwegian&SrcText=$eng"); + my $result = get("http://ets.freetranslation.com:5081/?Sequence=core&Mode=txt&template=TextResults2.htm&Language=English/Norwegian&SrcText=$eng"); Irssi::command("/echo [$nick] $result"); } } sub trans { - - if($translate =0) { $translate=1; } else { $translate =0; } + Irssi::print $translate; + $translate = 1 - $translate; } Irssi::signal_add("message public", "income"); |
