From db22869e4e5c72618ecea57d30e94ea05fe24ada Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 22 Jun 2011 18:11:20 +0200 Subject: [PATCH] rework answer --- brmd/brmd.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brmd/brmd.pl b/brmd/brmd.pl index 72a61aa..25c9262 100755 --- a/brmd/brmd.pl +++ b/brmd/brmd.pl @@ -546,7 +546,6 @@ sub irc_public { } if ( my ($alpha) = $what =~ /^!alpha (.+)/ ) { - my $answer = ''; my $wa = WWW::WolframAlpha->new ( appid => 'P6XPHG-URK5HXVWXL', ); my $query = $wa->query( input => $alpha, ); if ($query->success) { @@ -554,15 +553,16 @@ sub irc_public { if (!$pod->error) { foreach my $subpod (@{$pod->subpods}) { if ($subpod->plaintext) { + my $answer = ''; $answer .= ($pod->title . ': ') if $pod->title; $answer .= ($subpod->title . ': ') if $subpod->title; - $answer .= ($subpod->plaintext . "\n"); + $answer .= $subpod->plaintext; + $irc->yield( privmsg => $channel => $answer ); } } } } } - $irc->yield( privmsg => $channel => $answer ) if $answer; } }