]> git.donarmstrong.com Git - infobot.git/commitdiff
ws
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 11 Nov 2003 21:33:00 +0000 (21:33 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 11 Nov 2003 21:33:00 +0000 (21:33 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@880 c11ca15a-4712-0410-83d8-924469b57eb5

43 files changed:
ChangeLog
ChangeLog.old
INSTALL
INSTALL.mysql
INSTALL.sqlite
README
blootbot
doc/cmd.list
doc/old/BUGS
doc/old/USAGE
old/Freshmeat_II.pl
old/News.pl
old/dbm.pl
patches/Google.pm
scripts/dbm2mysql.pl
scripts/irclog2html.pl
scripts/makepasswd
scripts/oreilly_prettyp.pl
scripts/showvars.pl
src/CommandStubs.pl
src/Factoids/Norm.pl
src/Factoids/Reply.pl
src/IRC/Irc.pl
src/IRC/IrcHooks.pl
src/IRC/Schedulers.pl
src/Misc.pl
src/Modules/Countdown.pl
src/Modules/Exchange.pl
src/Modules/Factoids.pl
src/Modules/HTTPDtype.pl
src/Modules/News.pl
src/Modules/Quote.pl
src/Modules/Units.pl
src/Modules/Weather.pl
src/Modules/babel.pl
src/Modules/insult.pl
src/Modules/zfi.pl
src/Modules/zsi.pl
src/Shm.pl
src/UserExtra.pl
src/core.pl
src/dbi.pl
src/modules.pl

index 9039653fa3921d6f9c2080447b7530eeeb902bee..8491f04986f2a3ae744ecd8310511b15949b144d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
              and opt-out (news unnotify)
        irchooks: splitted into IrcHelpers.pl so we can reload it on the fly.
        factoids: added debugging for short factoids that may be botched up
-                 references
+             references
 
 2001-04-12 21:12  dms
 
index 0986ea0d00872559d7e610a265d58b6c15f4dac6..5d10ab177c8f1f9b81048b8504a2fadd0940eb44 100644 (file)
@@ -3,11 +3,11 @@ v1.0.0 (20000725): bug fixes mainly.
        - Fixed warning in Modules/Uptime.pl for clean install.
        - More fixes for scripts/*mysql*.pl from GmLB.
        - Added command 'hex'.
-       - GmLB fixed mysql2txt.pl and txt2mysql.pl. You can now import and 
+       - GmLB fixed mysql2txt.pl and txt2mysql.pl. You can now import and
          export to inforbot 'factpacks'.-
 
 v1.0.0RC3 (20000720): bug fixes mainly.
-       - Debian.pl's infoPackages() now checks for incoming 
+       - Debian.pl's infoPackages() now checks for incoming
          automatically and shows the new file.
        - irq/dan found the bot wouldn't run if a stale (invalid) pid
          file exists. Fixed.
@@ -215,7 +215,7 @@ v1.0.0pre3 (20000319):
        - Fixed Freshmeat.pl not to show duplicate packages found by
          'name' and 'oneliner' search. Made showPackage() function.
        - Debian modules now does multi distro. (woody's non-us appears to
-         be different structure so does not work :(, very crude hack... 
+         be different structure so does not work :(, very crude hack...
          may not even work).
        - Added subfactoid randomising. eg: '(one|two|three)'.
        - 'dauthor' now works!
@@ -317,7 +317,7 @@ v0.99pre12 (20000125):
 
 v0.99pre11 (20000123):
        - Fixes here and there...
-       - Debian find now searches Package names. Fallback automatically 
+       - Debian find now searches Package names. Fallback automatically
          to contents file search.
        - Fixed typo related to log cycling.
        - Added netsplit detection code.
@@ -601,7 +601,7 @@ v0.17.0 (19991126):
                - Ability to turn off minVolunteerLength.
                - More changes to prevent chatter in unaddressed manner.
        - We remove any ansi or control chars when piping to the log file.
-         RevHippie++. 
+         RevHippie++.
        - Added 'thanks' language.
        - Typo in Freshmeat.pl; Fixed.
        - Added $rootwarnmode = passive || aggressive to satisfy lilo@OPN.
diff --git a/INSTALL b/INSTALL
index ef5ee58dfecb7b61736d6384e7da2f5f306e919c..08d8a638ba035088f1ea086bc2f8e0778940b246 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -8,19 +8,19 @@ Method of installation.
 - Edit files/blootbot.chan to set which channels to join.
 
 - Install the following Perl modules:
-        - Net::IRC perl module
-            - Debian: (apt-get install libnet-irc-perl)
-        - WWW::Search
-            - Debian: (apt-get install libwww-search-perl)
-        - LWP
-            - Debian: (apt-get install libwww-perl)
-        - HTML::Parser
-            - Debian: (apt-get install libhtml-parser-perl)
+       - Net::IRC perl module
+           - Debian: (apt-get install libnet-irc-perl)
+       - WWW::Search
+           - Debian: (apt-get install libwww-search-perl)
+       - LWP
+           - Debian: (apt-get install libwww-perl)
+       - HTML::Parser
+           - Debian: (apt-get install libhtml-parser-perl)
 
 - Choose your database:
-        - MySQL, read INSTALL.mysql (supported)
-        - SQLite, read INSTALL.sqlite (supported)
-        - PgSQL, read INSTALL.pgsql (unsupported, may work)
+       - MySQL, read INSTALL.mysql (supported)
+       - SQLite, read INSTALL.sqlite (supported)
+       - PgSQL, read INSTALL.pgsql (unsupported, may work)
 
 - There are "bugs" in the perl modules.  Read INSTALL.patches on how to fix.
 
index 40063e541c7edb491845092054d09d873f11abf4..5de7a165ee81ca2e2a1ca8b0d443533e358ad792 100644 (file)
@@ -11,10 +11,10 @@ INSTALL.mysql
 
 = Possible problems
     - if connection to localhost is (short) refused, run
-            '/etc/init.d/mysql stop'
-            '/etc/init.d/mysql start'
+           '/etc/init.d/mysql stop'
+           '/etc/init.d/mysql start'
     - if connection for user is refused, reload grant tables with
-            'mysqladmin -u root -p reload'
+           'mysqladmin -u root -p reload'
 
 * [OPTIONAL]
     - run 'scripts/dbm2mysql.pl old-db' to convert dbm database file
index ec3b9c5f43782eeee0873cccbbca06d56feadefb..c156712c915b27aa9f95c22ff82833da1b53a019 100644 (file)
@@ -17,7 +17,7 @@ other distros might need to build from sources.
 
 SQLite sources:
 
-http://www.hwaci.com/sw/sqlite/ 
+http://www.hwaci.com/sw/sqlite/
 
 DBD::SQLite sources:
 
diff --git a/README b/README
index 092e4165be3965ee4028caffa7d6d90d5a779e55..7d080ffa9a95da378b349f3c475d41c092aa2dc9 100644 (file)
--- a/README
+++ b/README
@@ -50,7 +50,7 @@ cases. preliminary pgsql support has been added but someone with pgperl
 knowledge needs to fix it up or at least unify the module with mysql.
 
 INSTALLATION
-  - Read the included INSTALL file 
+  - Read the included INSTALL file
 
 NOTICE
        Be warned that this bot consumes quite a lot of memory upon start
@@ -66,7 +66,7 @@ However, these people do not realize the potential of open wingates.
 test all modifications properly (and extensively).  Suggestions are
 welcomed.
 
-       gp@OPN is currently working on a C version of infobot or 
+       gp@OPN is currently working on a C version of infobot or
 blootbot, not based on the above source base.  Core factoid code and
 mysql support works - but that is it.
 
@@ -80,7 +80,7 @@ features listed in 'TODO'.
 you to find the cookies than for me to hand-feed them to you ;)
 
        See 'EXAMPLES' for various usage of factoids and "hidden"
-variables.  If you're hardcore, check out 'CommandStubs.pl' and 
+variables.  If you're hardcore, check out 'CommandStubs.pl' and
 'UserExtras.pl' for cool features.
 
        topic [help]            - Topic help.
index 5be764241267ddb8b484246468da68a5eecd7030..323c12258666972ed11be3e63357591cd4cdc158 100755 (executable)
--- a/blootbot
+++ b/blootbot
@@ -5,7 +5,7 @@
 
 use strict;
 use vars qw($bot_base_dir $bot_src_dir $bot_misc_dir $bot_state_dir
-           $bot_data_dir $bot_config_dir $bot_log_dir $bot_run_dir 
+           $bot_data_dir $bot_config_dir $bot_log_dir $bot_run_dir
            $bot_pid $memusage %param
 );
 
@@ -47,7 +47,7 @@ BEGIN {
 # prevent duplicate processes of the same bot
 &duperuncheck();
 
-# initialize everything 
+# initialize everything
 &startup();    # first time initialization.
 &setup();
 
index 8cf384ab095164281246a1968484c143e1942662..17600a6595004abab8c2f3e7ad18137b1156c2a1 100644 (file)
     if ($message =~ /^wantNick$/i) {
 &addCmdHook("main", 'chan(stats|info)', ('CODEREF' => 'chaninfo', ) );
 &addCmdHook("main", 'cmd(stats|info)', ('CODEREF' => 'cmdstats', ) );
-&addCmdHook("main", 'factinfo', ('CODEREF' => 'factinfo', 
-&addCmdHook("main", 'factstats?', ('CODEREF' => 'factstats', 
-&addCmdHook("main", 'help', ('CODEREF' => 'help', 
+&addCmdHook("main", 'factinfo', ('CODEREF' => 'factinfo',
+&addCmdHook("main", 'factstats?', ('CODEREF' => 'factstats',
+&addCmdHook("main", 'help', ('CODEREF' => 'help',
 &addCmdHook("main", 'karma', ('CODEREF' => 'karma', ) );
-&addCmdHook("main", 'i?spell', ('CODEREF' => 'ispell', 
-&addCmdHook("main", 'd?nslookup', ('CODEREF' => 'DNS', 
-&addCmdHook("main", 'tell|explain', ('CODEREF' => 'tell', 
-&addCmdHook("main", 'news', ('CODEREF' => 'News::Parse', 
-&addCmdHook("main", 'countrystats', ('CODEREF' => 'countryStats', 
+&addCmdHook("main", 'i?spell', ('CODEREF' => 'ispell',
+&addCmdHook("main", 'd?nslookup', ('CODEREF' => 'DNS',
+&addCmdHook("main", 'tell|explain', ('CODEREF' => 'tell',
+&addCmdHook("main", 'news', ('CODEREF' => 'News::Parse',
+&addCmdHook("main", 'countrystats', ('CODEREF' => 'countryStats',
 # Modules/UserDCC.pl
     if ($message =~ /^(exit|quit)$/i) {
     if ($message =~ /^who$/) {
index 9c45512cfae5cea1b999a7ab7e490e1c8e8254c8..72f3449e57c86f9c1f62111b166e883a72d1b621 100644 (file)
@@ -15,7 +15,7 @@ Problem #2: [UPDATED 20000224]
        has not received notification of the new topic before
        changing to the second modification of the topic, it
        would use the absolute first (0) topic as a reference,
-       therefore missing out on the first alteration of the 
+       therefore missing out on the first alteration of the
        topic.
 
        A very cheap solution exists. Edit IrcHooks.pl, search for
@@ -53,7 +53,7 @@ Problem #4: 199912xx
        just 1 (total of 2), depending on the return of SELECT. If this
        still persists and memory leaks are happening, first make
        sure you are not using broken mysql tables, secondly bitch at the
-       mysql-perl author that there is a memory leak when a broken table 
+       mysql-perl author that there is a memory leak when a broken table
        is in use.
 
 Problem #5:
@@ -71,7 +71,7 @@ Problem #5:
        since __WARN__ hooks are not called from inside one.
 
        ### From 'perlvar'...
-       Note that __DIE__/__WARN__ handlers are very special in one 
+       Note that __DIE__/__WARN__ handlers are very special in one
        respect: they may be called to report (probable) errors found by
        the parser.  In such a case the parser may be in inconsistent
        state, so any attempt to evaluate Perl code from such a handler
index 8f085ab9df46a5f69bdea0370e060cf26d3f04ff..d922ed7318566d9654d45f7e338d280979db1670 100644 (file)
@@ -6,9 +6,9 @@
 =      ===       ===     ====     ======  =====      ====     ======  ====
 ==========================================================================
 
-                    ======================================
-                                USER COMMANDS
-                    ======================================
+                   ======================================
+                               USER COMMANDS
+                   ======================================
 
 Command: 4op
 =============
@@ -215,7 +215,7 @@ Usage:
 Example:
        > blootbot: chanstats
        <blootbot> i am on 2 channels: #blootbot #debian
-       <blootbot> i've cached 5 users distributed over 2 channels.     
+       <blootbot> i've cached 5 users distributed over 2 channels.
 
        > blootbot: chanstats #blootbot
        <blootbot> On #blootbot, there have been 1 Join, 1 Op and 20
@@ -366,9 +366,9 @@ Example:
 
 
 
-                    ======================================
-                               MODULE COMMANDS
-                    ======================================
+                   ======================================
+                              MODULE COMMANDS
+                   ======================================
 
 Command: babelfish
 =============
@@ -623,9 +623,9 @@ Example: DOES NOT WORK
 
 
 
-                    ======================================
-                        MISCELLANEOUS/FACTOID COMMANDS
-                    ======================================
+                   ======================================
+                       MISCELLANEOUS/FACTOID COMMANDS
+                   ======================================
 
 Command: forget
 =============
index f543c544e507e74a260171f16daa323b74f66074..470b20103238dc1dce2df2809847fe23fd1a2b0b 100644 (file)
@@ -172,7 +172,7 @@ sub downloadIndex {
 
     ### lets get on with business.
     # set the last refresh time. fixes multiple spawn bug.
-    &::dbSet("freshmeat", 
+    &::dbSet("freshmeat",
        { "projectname_short"   => "_" },
        { "latest_version"      => time(),
          "desc_short"          => "dummy project to track date" }
@@ -341,7 +341,7 @@ sub xml_end {
 
        if ($i % 200 == 0 and $i != 0) {
            &::showProc();
-           &::status("FM: unlocking and locking ($i): ". 
+           &::status("FM: unlocking and locking ($i): ".
                &::Time2String( time() - $locktime ) );
            $locktime = time();
 
index 1c1629d8f91ddce4f384fa4c67acf9f02c8aba2c..e03f9a32e88b65d6ac327d3f3b5e6c77b54564ea 100644 (file)
@@ -542,7 +542,7 @@ sub mod {
        if ($flags eq "") {
            $done++ if (!$done and $mod_news  =~ s/\Q$op\E/$np/);
            $done++ if (!$done and $mod_nnews =~ s/\Q$op\E/$np/);
-        } elsif ($flags eq "g") {
+       } elsif ($flags eq "g") {
            $done++ if ($mod_news  =~ s/\Q$op\E/$np/g);
            $done++ if ($mod_nnews =~ s/\Q$op\E/$np/g);
        }
@@ -799,7 +799,7 @@ sub latest {
     if (!$flag) {
        return unless ($unread);
 
-       # just a temporary measure not to flood ourself off the 
+       # just a temporary measure not to flood ourself off the
        # network with news until we get global notice() and msg()
        # throttling.
        if (time() - ($::cache{newsTime} || 0) < 5) {
@@ -831,7 +831,7 @@ sub latest {
            $i   = &newsS2N($_);
            $sorted[$i] = $_;
        }
-       
+
        for ($i=0; $i<=scalar(@sorted); $i++) {
            my $news = $sorted[$i];
            next unless (defined $news);
index 0048143fa1ab457f03e6dc95d8c5a93a069b8615..8dc5d4b8e8cc0257a46e48c6bdb5bdfc1ba5cae2 100644 (file)
@@ -346,7 +346,7 @@ sub searchTable {
 
     if (!scalar &dbGetColInfo($table)) {
        return;
-    }   
+    }
 
     my @results;
     foreach (keys %{$table}) {
@@ -391,7 +391,7 @@ sub getFactInfo {
     }
 
     &ERROR("gFI: should never happen.");
-}   
+}
 
 #####
 # Usage: &getFactoid($faqtoid);
index 869eed36612abee3d04f3421d17de90a8c0d0f59..04f586ec61b430f5bc0aba8134e96fc225e18a31 100644 (file)
@@ -11,7 +11,7 @@ package WWW::Search::Google;
 
 =head1 NAME
 
-WWW::Search::Google - class for searching Google 
+WWW::Search::Google - class for searching Google
 
 
 =head1 SYNOPSIS
@@ -58,7 +58,7 @@ page in C<{_next_url}>.
 C<native_retrieve_some> is called (from C<WWW::Search::retrieve_some>)
 whenever more hits are needed.  It calls C<WWW::Search::http_request>
 to fetch the page specified by C<{_next_url}>.
-It then parses this page, appending any search hits it finds to 
+It then parses this page, appending any search hits it finds to
 C<{cache}>.  If it finds a ``next'' button in the text,
 it sets C<{_next_url}> to point to the page for the next
 set of results, otherwise it sets it to undef to indicate we''re done.
@@ -66,7 +66,7 @@ set of results, otherwise it sets it to undef to indicate we''re done.
 
 =head1 TESTING
 
-This module adheres to the C<WWW::Search> test suite mechanism. 
+This module adheres to the C<WWW::Search> test suite mechanism.
 
 =head1 AUTHOR
 
@@ -75,7 +75,7 @@ This backend is written and maintained/supported by Jim Smyser.
 
 =head1 BUGS
 
-Google is not an easy search engine to parse in that it is capable 
+Google is not an easy search engine to parse in that it is capable
 of altering it's output ever so slightly on different search terms.
 There may be new slight results output the author has not yet seen that
 will pop at any given time for certain searches. So, if you think you see
@@ -94,11 +94,11 @@ Minor code correction for empty returned titles
 Forgot to add new next url regex in 2.19!
 
 2.19
-Regex work on some search results url's that has changed. Number found 
+Regex work on some search results url's that has changed. Number found
 return should be right now.
 
 2.17
-Insert url as a title when no title is found. 
+Insert url as a title when no title is found.
 
 2.13
 New regexp to parse newly found results format with certain search terms.
@@ -118,7 +118,7 @@ Added Kingpin's new hash_to_cgi_string() 10/12/99
 Fixed missing links / regexp crap.
 
 2.05
-Matching overhaul to get the code parsing right due to multiple 
+Matching overhaul to get the code parsing right due to multiple
 tags being used by google on the hit lines. 9/25/99
 
 2.02
@@ -139,10 +139,10 @@ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 =cut
 #'
-          
-          
+
+
 #####################################################################
-          
+
 require Exporter;
 @EXPORT = qw();
 @EXPORT_OK = qw();
@@ -156,12 +156,12 @@ $TEST_CASES = <<"ENDTESTCASES";
 &test('Google', '$MAINTAINER', 'one_page', '+LS'.'AM +rep'.'lication', \$TEST_RANGE, 2,99);
 &test('Google', '$MAINTAINER', 'multi', 'dir'.'ty ha'.'rr'.'y bimbo', \$TEST_GREATER_THAN, 101);
 ENDTESTCASES
-          
+
 use Carp ();
 use WWW::Search(qw(generic_option strip_tags));
 require WWW::SearchResult;
-          
-          
+
+
 sub undef_to_emptystring {
 return defined($_[0]) ? $_[0] : "";
 }
@@ -172,12 +172,12 @@ sub native_setup_search
      $self->user_agent('user');
      $self->{_next_to_retrieve} = 0;
      $self->{'_num_hits'} = 100;
-         if (!defined($self->{_options})) {
-         $self->{_options} = {
-         'search_url' => 'http://www.google.com/search',
-         'num' => $self->{'_num_hits'},
-         };
-         };
+        if (!defined($self->{_options})) {
+        $self->{_options} = {
+        'search_url' => 'http://www.google.com/search',
+        'num' => $self->{'_num_hits'},
+        };
+        };
      my($options_ref) = $self->{_options};
      if (defined($native_options_ref)) {
      # Copy in new options.
@@ -195,7 +195,7 @@ sub native_setup_search
      $self->{_debug} = $options_ref->{'search_debug'};
      $self->{_debug} = 2 if ($options_ref->{'search_parse_debug'});
      $self->{_debug} = 0 if (!defined($self->{_debug}));
-               
+
      # Finally figure out the url.
      $self->{_base_url} =
      $self->{_next_url} =
@@ -203,7 +203,7 @@ sub native_setup_search
      "?" . $options .
      "q=" . $native_query;
      }
-          
+
 # private
 sub begin_new_hit {
      my($self) = shift;
@@ -236,13 +236,13 @@ sub native_retrieve_some {
      foreach ($self->split_lines($response->content())) {
      next if m@^$@; # short circuit for blank lines
 
-  if ($state == $HEADER && m/about <b>([\d,]+)<\/b>/) 
+  if ($state == $HEADER && m/about <b>([\d,]+)<\/b>/)
      {
      my($n) = $1;
      $self->approximate_result_count($n);
      print STDERR "Found Total: $n\n" ;
      $state = $HITS;
-     } 
+     }
   if ($state == $HITS &&
      m|<p><a href=([^\>]*)\>(.*?)</a\><br\>|i) {
      my ($url, $title) = ($1,$2);
@@ -255,7 +255,7 @@ sub native_retrieve_some {
      $title = "No Title" if ($title =~ /^\s+/);
      $hit->title(strip_tags($title));
      $state = $HITS;
-     } 
+     }
   elsif ($state == $HITS &&
      m|<a href=(.*)\>(.*?)</a><font size=-1><br><font color=green><.*?>|i) {
      my ($url, $title) = ($1,$2);
@@ -268,7 +268,7 @@ sub native_retrieve_some {
      $title = "No Title" if ($title =~ /^\s+/);
      $hit->title(strip_tags($title));
      $state = $HITS;
-     } 
+     }
   elsif ($state == $HITS &&
      m@^<p><a href=/url\?sa=U&start=\d+&q=([^<]+)\&.*?>(.*)</a><font size=-1><br>(.*)@i ||
      m@^<p><a href=([^<]+)>(.*)</a>.*?<font size=-1><br>(.*)@i)
@@ -289,8 +289,8 @@ sub native_retrieve_some {
      $mDesc =  $mDesc . '<br>' if not $mDesc =~ m@<br>@;
      $hit->description($mDesc) if (defined($hit));
      $state = $HITS;
-     } 
-  elsif ($state == $HITS && m@^(\.\.(.+))@i) 
+     }
+  elsif ($state == $HITS && m@^(\.\.(.+))@i)
      {
      print STDERR "**Parsing Description Line**\n" if ($self->{_debug});
      $raw .= $_;
@@ -301,16 +301,16 @@ sub native_retrieve_some {
      $hit->description($sDesc) if $sDesc =~ m@^\.@;
      $sDesc = '';
      $state = $HITS;
-     } 
-  elsif ($state == $HITS && m@<div class=nav>@i) 
+     }
+  elsif ($state == $HITS && m@<div class=nav>@i)
      {
      ($hit, $raw) = $self->begin_new_hit($hit, $raw);
      print STDERR "**Found Last Line**\n" if ($self->{_debug});
      # end of hits
      $state = $TRAILER;
-     } 
-  elsif ($state == $TRAILER && 
-     m|<a href=([^<]+)><IMG SRC=/nav_next.gif.*?>.*?|i) 
+     }
+  elsif ($state == $TRAILER &&
+     m|<a href=([^<]+)><IMG SRC=/nav_next.gif.*?>.*?|i)
      {
      my($relative_url) = $1;
      print STDERR "**Fetching >>Next<< Page**\n" if ($self->{_debug});
index 2a28679d714479605f2b589f0d14771aa425b221..d9f6c319a44e741c0dc7749b7bdade458451fcf5 100755 (executable)
@@ -53,7 +53,7 @@ foreach $factoid (keys %db) {
        }
     } else {
        # infobot dbm to blootbot sql support.
-        &sqlReplace("factoids", {
+       &sqlReplace("factoids", {
                factoid_key     => $_,
                factoid_value   => $db{$_},
        } );
index 6714ffd2d3039e310dbe002cfb09717cc965f579..cad4d841d7666dec292ab08fef65e61d2dfcf996 100755 (executable)
@@ -273,7 +273,7 @@ sub main {
 
                        elsif ($line =~ /^&gt\;&gt\;&gt\; /) {
                                $line =~ s/^&gt\;&gt\;&gt\; /\*\*\* /;
-                                       
+
                                # Process changed nick results, and remember colours accordingly #
                                if ($line =~ /\*\*\* (.*?) are|is now known as (.*)/) {
                                        my $nick_old;
index 897a4aaa49c31bf354a6a36d559592041c7a40d1..b76617ccfd6f3dc4972542cb68ef1b08a74dd133 100755 (executable)
@@ -14,7 +14,7 @@ sub mkpasswd {
     my $what = $_[0];
     my $salt = chr(65+rand(27)).chr(65+rand(27));
     $salt =~ s/\W/x/g;
-    
+
     return crypt($what, $salt);
 }
 
index 814a9735f2642cf278e0a49865fb97bdea65e4ed..db58d78646c1aaf465a5d5d8bd55f38b015f4bd9 100644 (file)
@@ -6,11 +6,11 @@ $level = -1; # Level of indentation
 sub pretty_print {
     my $var;
     foreach $var (@_) {
-        if (ref ($var)) {
-            print_ref($var);
-        } else {
-            print_scalar($var);
-        }
+       if (ref ($var)) {
+           print_ref($var);
+       } else {
+           print_scalar($var);
+       }
     }
 }
 
@@ -23,26 +23,26 @@ sub print_scalar {
 sub print_ref {
     my $r = $_[0];
     if (exists ($already_seen{$r})) {
-        print_indented ("$r (Seen earlier)");
-        return;
+       print_indented ("$r (Seen earlier)");
+       return;
     } else {
-        $already_seen{$r}=1;
+       $already_seen{$r}=1;
     }
     my $ref_type = ref($r);
     if ($ref_type eq "ARRAY") {
-        print_array($r);
+       print_array($r);
     } elsif ($ref_type eq "SCALAR") {
-        print "Ref -> $r";
-        print_scalar($$r);
+       print "Ref -> $r";
+       print_scalar($$r);
     } elsif ($ref_type eq "HASH") {
-        print_hash($r);
+       print_hash($r);
     } elsif ($ref_type eq "REF") {
-        ++$level;
-        print_indented("Ref -> ($r)");
-        print_ref($$r);
-        --$level;
+       ++$level;
+       print_indented("Ref -> ($r)");
+       print_ref($$r);
+       --$level;
     } else {
-        print_indented ("$ref_type (not supported)");
+       print_indented ("$ref_type (not supported)");
     }
 }
 
@@ -51,11 +51,11 @@ sub print_array {
     ++$level;
     print_indented ("[ # $r_array");
     foreach $var (@$r_array) {
-        if (ref ($var)) {
-            print_ref($var);
-        } else {
-            print_scalar($var);
-        }
+       if (ref ($var)) {
+           print_ref($var);
+       } else {
+           print_scalar($var);
+       }
     }
     print_indented ("]");
     --$level;
@@ -64,18 +64,18 @@ sub print_array {
 sub print_hash {
     my($r_hash) = @_;
     my($key, $val);
-    ++$level; 
+    ++$level;
     print_indented ("{ # $r_hash");
     while (($key, $val) = each %$r_hash) {
-        $val = ($val ? $val : '""');
-        ++$level;
-        if (ref ($val)) {
-            print_indented ("$key => ");
-            print_ref($val);
-        } else {
-            print_indented ("$key => $val");
-        }
-        --$level;
+       $val = ($val ? $val : '""');
+       ++$level;
+       if (ref ($val)) {
+           print_indented ("$key => ");
+           print_ref($val);
+       } else {
+           print_indented ("$key => $val");
+       }
+       --$level;
     }
     print_indented ("}");
     --$level;
index a8733e08982c07fe5618c515875063c33a3bc499..22c55acb817cfd6900662d0554f341bc2bc31f63 100644 (file)
@@ -29,11 +29,11 @@ $level = -1; # Level of indentation
 sub pretty_print {
     my $var;
     foreach $var (@_) {
-        if (ref ($var)) {
-            print_ref($var);
-        } else {
-            print_scalar($var);
-        }
+       if (ref ($var)) {
+           print_ref($var);
+       } else {
+           print_scalar($var);
+       }
     }
 }
 
@@ -46,26 +46,26 @@ sub print_scalar {
 sub print_ref {
     my $r = $_[0];
     if (exists ($already_seen{$r})) {
-        print_indented ("$r (Seen earlier)");
-        return;
+       print_indented ("$r (Seen earlier)");
+       return;
     } else {
-        $already_seen{$r}=1;
+       $already_seen{$r}=1;
     }
     my $ref_type = ref($r);
     if ($ref_type eq "ARRAY") {
-        print_array($r);
+       print_array($r);
     } elsif ($ref_type eq "SCALAR") {
-        print "Ref -> $r";
-        print_scalar($$r);
+       print "Ref -> $r";
+       print_scalar($$r);
     } elsif ($ref_type eq "HASH") {
-        print_hash($r);
+       print_hash($r);
     } elsif ($ref_type eq "REF") {
-        ++$level;
-        print_indented("Ref -> ($r)");
-        print_ref($$r);
-        --$level;
+       ++$level;
+       print_indented("Ref -> ($r)");
+       print_ref($$r);
+       --$level;
     } else {
-        print_indented ("$ref_type (not supported)");
+       print_indented ("$ref_type (not supported)");
     }
 }
 
@@ -74,11 +74,11 @@ sub print_array {
     ++$level;
     print_indented ("[ # $r_array");
     foreach $var (@$r_array) {
-        if (ref ($var)) {
-            print_ref($var);
-        } else {
-            print_scalar($var);
-        }
+       if (ref ($var)) {
+           print_ref($var);
+       } else {
+           print_scalar($var);
+       }
     }
     print_indented ("]");
     --$level;
@@ -87,18 +87,18 @@ sub print_array {
 sub print_hash {
     my($r_hash) = @_;
     my($key, $val);
-    ++$level; 
+    ++$level;
     print_indented ("{ # $r_hash");
     while (($key, $val) = each %$r_hash) {
-        $val = ($val ? $val : '""');
-        ++$level;
-        if (ref ($val)) {
-            print_indented ("$key => ");
-            print_ref($val);
-        } else {
-            print_indented ("$key => $val");
-        }
-        --$level;
+       $val = ($val ? $val : '""');
+       ++$level;
+       if (ref ($val)) {
+           print_indented ("$key => ");
+           print_ref($val);
+       } else {
+           print_indented ("$key => $val");
+       }
+       --$level;
     }
     print_indented ("}");
     --$level;
index bdcaf0b107ed940672bbf059d0aac74331d4cfd6..7da444ec790176150a434ec4afa892d43285a9a2 100644 (file)
@@ -18,7 +18,7 @@ $w3search_regex   = "google";
 
 ### COMMAND HOOK IMPLEMENTATION.
 # addCmdHook("SECTION", 'TEXT_HOOK',
-#      (CODEREF        => 'Blah', 
+#      (CODEREF        => 'Blah',
 #      Forker          => 1,
 #      CheckModule     => 1,                   # ???
 #      Module          => 'blah.pl'            # preload module.
@@ -190,7 +190,7 @@ sub parseCmdHook {
        'Forker' => 1, 'Identifier' => 'kernel',
        'Cmdstats' => 'Kernel', 'NoArgs' => 1) );
 &addCmdHook("extra", 'listauth', ('CODEREF' => 'CmdListAuth',
-       'Identifier' => 'search', Module => 'factoids', 
+       'Identifier' => 'search', Module => 'factoids',
        'Help' => 'listauth') );
 &addCmdHook("extra", 'quote', ('CODEREF' => 'Quote::Quote',
        'Forker' => 1, 'Identifier' => 'quote',
index 7aba3d297cb20ac62ad0bc023c2935b608285442..028c72e4f015f0b5dde53e86550935f74201b02e 100644 (file)
@@ -28,7 +28,7 @@ sub normquery {
        s/,?\s*(pretty )*please\??\s*$/\?/i;
 
        # what country is ...
-       if ($in =~ 
+       if ($in =~
            s/wh(at|ich)\s+(add?res?s|country|place|net (suffix|domain))/wh$1 /ig) {
            if ((length($in) == 2) && ($in !~ /^\./)) {
                $in = '.'.$in;
index 4fc3b6053465b7f28780a1966966ca666ce35785..056f947e4100475dfe3ddf69642111c7e33e6d1c 100644 (file)
@@ -29,7 +29,7 @@ sub getReply {
     $message =~ tr/A-Z/a-z/;
     $message =~ s/^cmd:/CMD:/;
 
-    my ($count, $fauthor, $result) = &sqlSelect("factoids", 
+    my ($count, $fauthor, $result) = &sqlSelect("factoids",
        "requested_count,created_by,factoid_value",
        { factoid_key => $message }
     );
index 75ca4cc323398e360631a11e84efdd9b1d975fe1..ad557ae6cc9dd8ec75037aedc794193fada20894 100644 (file)
@@ -825,7 +825,7 @@ sub closeDCC {
 
     foreach $type (keys %dcc) {
        next if ($type ne uc($type));
+
        my $nick;
        foreach $nick (keys %{ $dcc{$type} }) {
            next unless (defined $nick);
index 4697d3f564a066a4c3c0055cf710a2eda9e77a89..9c9d87c06f70531924671117d36234add002135f 100644 (file)
@@ -899,7 +899,7 @@ sub on_public {
        $v++;
 
        # don't allow ppl to cheat the stats :-)
-       if (defined $t && $time - $t > 60) { 
+       if (defined $t && $time - $t > 60) {
            &sqlReplace("stats", {
                nick    => $who,
                type    => $x,
index 56b943846b9d7d783521a073afb3c6c6fb9e25c8..bf254ba6c6d46f85b2d92a68a8678df98bde668b 100644 (file)
@@ -1012,7 +1012,7 @@ sub factoidCheck {
     my $time   = time();
 
     foreach (@list) {
-       my $age = &getFactInfo($_, "modified_time");    
+       my $age = &getFactInfo($_, "modified_time");
 
        if (!defined $age or $age !~ /^\d+$/) {
            if (scalar @list > 50) {
index 76f11ebe0ad9de7502240a52bed3eccfa9e4db43..3163bb3201690e9970d289305af6e4929806326b 100644 (file)
@@ -96,7 +96,7 @@ sub timeget {
     } else {                   # the real thing.
        return [gettimeofday()];
     }
-}    
+}
 
 sub timedelta {
     my($start_time) = shift;
index 5a11948a0447514ecbe14a76c31552ba5e18f103..a5e9edffcaa9873a01566039814290f5912d62aa 100644 (file)
@@ -50,7 +50,7 @@ sub Countdown {
            $monname = (&sqlRawReturn("SELECT MONTHNAME('$sqldate')"))[0];
 
        } elsif ($param{'DBType'} =~ /^pgsql$/i) {
-           $to_days = (&sqlRawReturn("SELECT date_trunc('day', 
+           $to_days = (&sqlRawReturn("SELECT date_trunc('day',
                                'now'::timestamp - '$sqldate')"))[0];
            $dayname = qw(Sun Mon Tue Wed Thu Fri Sat)[(&sqlRawReturn("SELECT extract(dow from timestamp '$sqldate')"))[0]];
            $monname = qw(BAD Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)[(&sqlRawReturn("SELECT extract(month from timestamp '$sqldate')"))[0]];
index d20cea07aff641b0693c275ec6aaeb759ffeec7a..ae8470f3e85f2f8cf74796793ab3e01385d1f97a 100644 (file)
@@ -277,7 +277,7 @@ sub exchange {
     my ($message) = @_;
     &::DEBUG("exchange(@_)");
 
-    return "Exchange.pl needs LWP::UserAgent and HTTP::Request::Common" 
+    return "Exchange.pl needs LWP::UserAgent and HTTP::Request::Common"
        if ($no_exchange);
 
     my ($From, $To, $Amount, $Country);
@@ -293,8 +293,9 @@ sub exchange {
     }
 
     my $ua = new LWP::UserAgent;
-    #$ua->agent("Mozilla/5.0 " . $ua->agent);        # Let's pretend
-    $ua->agent("Mozilla/5.0");        # Let's pretend
+    # Let's pretend
+    #$ua->agent("Mozilla/5.0 " . $ua->agent);
+    $ua->agent("Mozilla/5.0");
     $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy"));
     $ua->timeout(10);
 
@@ -316,7 +317,7 @@ sub exchange {
 
     if ($Country) {
        # Country lookup
-       # crysflame++ for the space fix. 
+       # crysflame++ for the space fix.
        $retval = '';
        foreach my $Found (grep /$Country/i, keys %CurrLookup){
            $Found =~ s/,/ uses/g;
@@ -355,9 +356,11 @@ sub exchange {
            # Falsify where we came from
            $req->referer($Referer);
 
-           my $res = $ua->request($req);                   # Submit request
+           # Submit request
+           my $res = $ua->request($req);
 
-           if ($res->is_success) {                         # Went through ok
+           if ($res->is_success) {
+               # Went through ok
                my $html = $res->as_string;
                # parse each one to avoid undefined warnings
                my ($When) = ($html =~ m/ as of (\d{4}\.\d\d.\d\d\s\d\d:\d\d:\d\d\s\S+)/gi);
@@ -372,7 +375,8 @@ sub exchange {
                } else {
                    return "i got some error trying that";
                }
-           } else {                                        # Oh dear.
+           } else {
+               # Oh dear.
                return "EXCHANGE: ". $res->status_line;
            }
        } else {
index ef80889ffff147141cddf412b24657e1004017fc..438471f5ca3ed4467704b9684d3f46baad727ef1 100644 (file)
@@ -172,7 +172,7 @@ sub CmdFactStats {
        return &formListReply(0, $prefix, @list);
 
     } elsif ($type =~ /^vandalism$/i) {
-        &status("factstats(vandalism): starting...");
+       &status("factstats(vandalism): starting...");
        my $start_time  = &timeget();
        my %data        = &sqlSelectColHash("factoids",
                "factoid_key,factoid_value", undef,
@@ -181,7 +181,7 @@ sub CmdFactStats {
        my @list;
 
        my $delta_time  = &timedelta($start_time);
-        &status(sprintf("factstats(vandalism): %.02f sec to retreive all factoids.", $delta_time)) if ($delta_time > 0);
+       &status(sprintf("factstats(vandalism): %.02f sec to retreive all factoids.", $delta_time)) if ($delta_time > 0);
        $start_time     = &timeget();
 
        # parse the factoids.
@@ -193,7 +193,7 @@ sub CmdFactStats {
        }
 
        $delta_time     = &timedelta($start_time);
-        &status(sprintf("factstats(vandalism): %.02f sec to complete.", $delta_time)) if ($delta_time > 0);
+       &status(sprintf("factstats(vandalism): %.02f sec to complete.", $delta_time)) if ($delta_time > 0);
 
        # bail out on no results.
        if (scalar @list == 0) {
@@ -205,7 +205,7 @@ sub CmdFactStats {
        return &formListReply(1, $prefix, @list);
 
     } elsif ($type =~ /^total$/i) {
-        &status("factstats(total): starting...");
+       &status("factstats(total): starting...");
        my $start_time  = &timeget();
        my @list;
        my $str;
@@ -257,7 +257,7 @@ sub CmdFactStats {
        ### end of "job".
 
        my $delta_time  = &timedelta($start_time);
-        &status(sprintf("factstats(broken): %.02f sec to retreive all factoids.", $delta_time)) if ($delta_time > 0);
+       &status(sprintf("factstats(broken): %.02f sec to retreive all factoids.", $delta_time)) if ($delta_time > 0);
        $start_time     = &timeget();
 
        # bail out on no results.
@@ -303,9 +303,9 @@ sub CmdFactStats {
        return &formListReply(1, $prefix, @newlist);
 
     } elsif ($type =~ /^dup(licate|e)$/i) {
-        &status("factstats(dupe): starting...");
+       &status("factstats(dupe): starting...");
        my $start_time  = &timeget();
-       my %hash        = &sqlSelectColHash("factoids", 
+       my %hash        = &sqlSelectColHash("factoids",
                "factoid_key,factoid_value", undef,
                "WHERE factoid_value IS NOT NULL", 1
        );
@@ -339,7 +339,7 @@ sub CmdFactStats {
 
        &status("factstats(dupe): (good) dupe refs: $refs.");
        my $delta_time  = &timedelta($start_time);
-        &status(sprintf("factstats(dupe): %.02f sec to complete", $delta_time)) if ($delta_time > 0);
+       &status(sprintf("factstats(dupe): %.02f sec to complete", $delta_time)) if ($delta_time > 0);
 
        # bail out on no results.
        if (scalar @list == 0) {
@@ -424,7 +424,7 @@ sub CmdFactStats {
        return &formListReply(1, $prefix, @list);
 
     } elsif ($type =~ /^locked$/i) {
-       my %hash = &sqlSelectColhash("factoids", 
+       my %hash = &sqlSelectColhash("factoids",
                "factoid_key,locked_by", undef,
                "WHERE locked_by IS NOT NULL"
        );
@@ -507,7 +507,7 @@ sub CmdFactStats {
        }
 
        my $delta_time = sprintf("%.02fs", &timedelta($start_time) );
-        &status("factstats(partdupe): $delta_time sec to complete.") if ($delta_time > 0);
+       &status("factstats(partdupe): $delta_time sec to complete.") if ($delta_time > 0);
 
        # bail out on no results.
        if (scalar @list == 0) {
index 3494846d113b7895a25135d87929baf560fc2109..b65cc75138c4b60d1680b7bd8b484551f027e4f8 100644 (file)
@@ -16,15 +16,15 @@ sub HTTPDtype {
     return unless &::loadPerlModule("Net::HTTP::NB");
     return unless &::loadPerlModule("IO::Select");
 
-        my $s = Net::HTTP::NB->new(Host => $HOST) || return;
-        $s->write_request(HEAD => "/");
+       my $s = Net::HTTP::NB->new(Host => $HOST) || return;
+       $s->write_request(HEAD => "/");
 
-        my $sel = IO::Select->new($s);
-        $line = "Header timeout" unless $sel->can_read(10);
-        ($code, $mess, %h) = $s->read_response_headers;
+       my $sel = IO::Select->new($s);
+       $line = "Header timeout" unless $sel->can_read(10);
+       ($code, $mess, %h) = $s->read_response_headers;
 
-        $line = (length($h{Server}) > 0) ? $h{Server} :
-          "Couldn't fetch headers from $HOST";
+       $line = (length($h{Server}) > 0) ? $h{Server} :
+         "Couldn't fetch headers from $HOST";
 
     &::pSReply($line||"Unknown Error Condition");
 
index 2afb80ad49c707f1f65e4d19937cadb65e254cf8..caee5f104751e0fab85324b543997dfecb8f4292 100644 (file)
@@ -542,7 +542,7 @@ sub mod {
        if ($flags eq "") {
            $done++ if (!$done and $mod_news  =~ s/\Q$op\E/$np/);
            $done++ if (!$done and $mod_nnews =~ s/\Q$op\E/$np/);
-        } elsif ($flags eq "g") {
+       } elsif ($flags eq "g") {
            $done++ if ($mod_news  =~ s/\Q$op\E/$np/g);
            $done++ if ($mod_nnews =~ s/\Q$op\E/$np/g);
        }
@@ -799,7 +799,7 @@ sub latest {
     if (!$flag) {
        return unless ($unread);
 
-       # just a temporary measure not to flood ourself off the 
+       # just a temporary measure not to flood ourself off the
        # network with news until we get global notice() and msg()
        # throttling.
        if (time() - ($::cache{newsTime} || 0) < 5) {
@@ -831,7 +831,7 @@ sub latest {
            $i   = &newsS2N($_);
            $sorted[$i] = $_;
        }
-       
+
        for ($i=0; $i<=scalar(@sorted); $i++) {
            my $news = $sorted[$i];
            next unless (defined $news);
index 39e152180e6a9aa069899068c3b2e1c233cb7fd1..147c230662cb9943e1776b2ac83f8fd128540391 100644 (file)
@@ -36,8 +36,8 @@ sub Quote {
        my ($ticker, $recent, $date, $time, $change, $open,
            $high, $low, $volume) = split(',',$result);
 
-        # add some commas
-        # "+ 0" removes trailing cr/lf/etc.
+       # add some commas
+       # "+ 0" removes trailing cr/lf/etc.
        my $newvol = commify($volume + 0);
 
        $reply .= ' ;; ' if $reply;
index bb973f7b6e736239ac946f1a817fc27c65c05441..ff16e7e91215413256092f922af750218487510f 100644 (file)
@@ -1,6 +1,6 @@
 #   Units.pl: convert units of measurement
 #     Author: M-J. Dominus (mjd-perl-units-id-iut+buobvys+@plover.com)
-#    License: GPL, Copyright (C) 1996,1999 
+#    License: GPL, Copyright (C) 1996,1999
 #       NOTE: Integrated into blootbot by xk.
 
 package Units;
@@ -122,7 +122,7 @@ sub convertUnits {
   } else {
     &::performStrictReply("$from cannot be correctly converted to $to.");
 
-#    print 
+#    print
 #      "conformability (Not the same dimension)\n",
 #      "\t", $from, " is ", text_unit($hu), "\n",
 #      "\t", $to, " is ", text_unit($wu), "\n",
@@ -149,7 +149,7 @@ sub read_defs {
     print ">>> $_\n" if $DEBUG_d;
     my $r = definition_line($_);
     unless (defined $r) {
-      warn "Error in line $. of $file: $PARSE_ERROR.  Skipping.\n";  
+      warn "Error in line $. of $file: $PARSE_ERROR.  Skipping.\n";
     }
   }
   print STDERR "Loaded file `$file'.\n" if $show_file_loading;
@@ -302,7 +302,7 @@ sub text_unit {
     $text .= " $d";
     $text .= "^$e" if $e > 1;
   }
-  
+
   $text;
 }
 ################################################################
@@ -313,7 +313,7 @@ sub text_unit {
 BEGIN {
   sub sh { ['shift', $_[0]]  };
   sub go { ['goto', $_[0]] };
-  @actions = 
+  @actions =
     (
      # Initial state
      {PREFIX => sh(1),
@@ -355,7 +355,7 @@ BEGIN {
       DIVIDE => sh(12),
       _ =>  ['reduce', 1, 'topunit'],
      },
-     # State 8:   unit -> constant . unit 
+     # State 8:   unit -> constant . unit
      #            unit -> constant .
      {PREFIX => sh(1),
       NUMBER => sh(2), # Shift-reduce conflict resolved in favor of shift
@@ -389,7 +389,7 @@ BEGIN {
      },
      # State 11:  unit -> unit TIMES . unit
      {PREFIX => sh(1),
-      NUMBER => sh(2), 
+      NUMBER => sh(2),
       NAME   => sh(3),
       FUNDAMENTAL => sh(4),
       FRACTION => sh(5),
@@ -399,7 +399,7 @@ BEGIN {
      },
      # State 12:  unit -> unit DIVIDE . unit
      {PREFIX => sh(1),
-      NUMBER => sh(2), 
+      NUMBER => sh(2),
       NAME   => sh(3),
       FUNDAMENTAL => sh(4),
       FRACTION => sh(5),
@@ -409,7 +409,7 @@ BEGIN {
      },
      # State 13:  unit -> unit . TIMES unit
      #            unit -> unit . DIVIDE unit
-     #            unit -> constant unit . 
+     #            unit -> constant unit .
      #            unit -> unit . NUMBER
      {NUMBER => sh(10), # Shift-reduce conflict resolved in favor of shift
       TIMES => sh(11),  # Shift-reduce conflict resolved in favor of shift
@@ -419,16 +419,16 @@ BEGIN {
      # State 14: unit => '(' unit ')' .
      { _ => ['reduce', 3, 'unit', sub {$_[1]}] },
      # State 15: unit  ->  unit . TIMES unit
-     #           unit  ->  unit TIMES unit . 
+     #           unit  ->  unit TIMES unit .
      #           unit  ->  unit . DIVIDE unit
-     #           unit  ->  unit . NUMBER 
+     #           unit  ->  unit . NUMBER
      {NUMBER => sh(10), # Shift-reduce conflict resolved in favor of shift
       _ => ['reduce', 3, 'unit', sub {unit_multiply($_[0], $_[2])}],
      },
      # State 16: unit  ->  unit . TIMES unit
-     #           unit  ->  unit DIVIDE unit . 
-     #           unit  ->  unit . DIVIDE unit 
-     #           unit  ->  unit . NUMBER  
+     #           unit  ->  unit DIVIDE unit .
+     #           unit  ->  unit . DIVIDE unit
+     #           unit  ->  unit . NUMBER
      {NUMBER => sh(10), # Shift-reduce conflict resolved in favor of shift
       _ => ['reduce', 3, 'unit', sub{unit_divide($_[2], $_[0])}],
      },
@@ -463,7 +463,7 @@ sub parse_unit {
       $PARSE_ERROR = 'Syntax error';
       return Zero;
     }
-    
+
     my ($primary, @actargs) = @$action;
     print STDERR "  $primary (@actargs)\n" if $DEBUG_p;
     if ($primary eq 'accept') {
@@ -489,7 +489,7 @@ sub parse_unit {
       push @state_st, $STATE;
 #      $STATE = $state_st[-1];
       print STDERR "Post-reduction state is $STATE.\n" if $DEBUG_p;
-      
+
       # Now look for `goto' actions
       my $goto = $actions[$STATE]{$result_type};
       unless ($goto && $goto->[0] eq 'goto') {
@@ -509,16 +509,16 @@ sub parse_unit {
 sub lex {
   my ($s) = @_;
   my @t = split /(
-                   \*{3}        # Special `new unit' symbol
-                |  [()*-]      # Symbol
-                |  \s*(?:\/|\bper\b)\s*      # Division
-               |  \d*\.\d+(?:[eE]-?\d+)? # Decimal number
-                |  \d+\|\d+     # Fraction
-                |  \d+          # Integer
-#                |  (?:$PREF)-?  # Prefix (handle differently)
+                  \*{3}        # Special `new unit' symbol
+               |  [()*-]       # Symbol
+               |  \s*(?:\/|\bper\b)\s*      # Division
+               |  \d*\.\d+(?:[eE]-?\d+)? # Decimal number
+               |  \d+\|\d+     # Fraction
+               |  \d+          # Integer
+#              |  (?:$PREF)-?  # Prefix (handle differently)
                |  [A-Za-z_][A-Za-z_.]* # identifier
-               |  \s+          # White space
-                )/ox, $s;
+               |  \s+          # White space
+               )/ox, $s;
   @t = grep {$_ ne ''} @t;     # Discard empty and all-white tokens
   \@t;
 }
index 1b3badec58f6963f6eee5794b909fbcdd994d6d2..bf1c05e017f8a9ddd9868c9c86ee2c6177ac7b66 100644 (file)
@@ -48,7 +48,7 @@ sub queryText {
 
        $ua->timeout(10);
        my $request = new HTTP::Request('GET', "http://weather.noaa.gov/weather/current/$station.html");
-       my $response = $ua->request($request); 
+       my $response = $ua->request($request);
 
        if (!$response->is_success) {
            if ($response->code == 404) {
index 720f4b0029a24d1045d71e6dbc46d15f4fd0b6a4..56dc42797dc50da2fd18d0a80888fbb50abb73b8 100644 (file)
@@ -27,23 +27,23 @@ BEGIN {
   # expects.
     use vars qw!%lang_code $lang_regex!;
     %lang_code = (
-                'fr' => 'fr',
-                'sp' => 'es',
-                'es' => 'es',
-                'po' => 'pt',
-                'pt' => 'pt',
-                'it' => 'it',
-                'ge' => 'de',
-                'de' => 'de',
-                'gr' => 'de',
-                'en' => 'en',
-                'zh' => 'zh',
-                'ja' => 'ja',
-                'jp' => 'ja',
-                'ko' => 'ko',
-                'kr' => 'ko',
-                'ru' => 'ru'
-               );
+               'fr' => 'fr',
+               'sp' => 'es',
+               'es' => 'es',
+               'po' => 'pt',
+               'pt' => 'pt',
+               'it' => 'it',
+               'ge' => 'de',
+               'de' => 'de',
+               'gr' => 'de',
+               'en' => 'en',
+               'zh' => 'zh',
+               'ja' => 'ja',
+               'jp' => 'ja',
+               'ko' => 'ko',
+               'kr' => 'ko',
+               'ru' => 'ru'
+              );
 
   # Here's how we recognize the language you're asking for.  It looks
   # like RTSL saves you a few keystrokes in #perl, huh?
@@ -60,7 +60,8 @@ sub babelfish {
 
   my $ua = new LWP::UserAgent;
   $ua->proxy('http', $::param{'httpProxy'}) if (&::IsParam("httpProxy"));
-  $ua->agent("Mozilla/4.5 " . $ua->agent);        # Let's pretend
+  # Let's pretend
+  $ua->agent("Mozilla/4.5 " . $ua->agent);
   $ua->timeout(5);
 
   my $req =
@@ -115,11 +116,11 @@ sub translate {
 
 if (0) {
     if (-t STDIN) {
-        #my $result = babel::babelfish('en','sp','hello world');
-        #my $result = babel::babelfish('en','sp','The cheese is old and moldy, where is the bathroom?');
-        my $result = babel::babelfish('en','gr','doesn\'t seem to translate things longer than 40 characters');
-        $result =~ s/; /\n/g;
-        print "Babelfish says: \"$result\"\n";
+       #my $result = babel::babelfish('en','sp','hello world');
+       #my $result = babel::babelfish('en','sp','The cheese is old and moldy, where is the bathroom?');
+       my $result = babel::babelfish('en','gr','doesn\'t seem to translate things longer than 40 characters');
+       $result =~ s/; /\n/g;
+       print "Babelfish says: \"$result\"\n";
     }
 }
 
index be37b914b80880ed0b792836b337b566466a4984..79b85e9d1820d66bf297f1c2cfb2b03b232fad68 100644 (file)
@@ -18,7 +18,7 @@ sub Insult {
 
     $line = "No luck, $::who" unless (defined $line);
 
-    if ($insultwho ne $::who) { 
+    if ($insultwho ne $::who) {
        $line =~ s/^\s*You are/$insultwho is/i;
     }
 
index fd689d98d0474b0cb56ada2899d4bc5b5603eac9..d63e176ed23f6c4a934082a270a433a73935ede1 100644 (file)
@@ -57,7 +57,7 @@ sub queryText {
        }
 
        my $request = new HTTP::Request('GET', "$searchpath");
-       my $response = $ua->request($request); 
+       my $response = $ua->request($request);
 
        if (!$response->is_success) {
                return "Something failed in connecting to the ZFI web server. Try again later.";
index faf2742d2aefd910af4f0ee14f298e0f402c8400..0347a027f3eb41b1bde6bcf54256d1e05e4e2e86 100644 (file)
@@ -57,7 +57,7 @@ sub queryText {
        }
 
        my $request = new HTTP::Request('GET', "$searchpath");
-       my $response = $ua->request($request); 
+       my $response = $ua->request($request);
 
        if (!$response->is_success) {
                return "Something failed in connecting to the ZSI web server. Try again later.";
index 0c3116bedd9c065e7d13a071a08d586d3e00496e..efdfced295665d79c98598e3a26facd549272e38 100644 (file)
@@ -235,7 +235,8 @@ sub shmFlush {
 
     my $time;
     my $shmmsg = &shmRead($shm);
-    $shmmsg =~ s/\0//g;         # remove padded \0's.
+    # remove padded \0's.
+    $shmmsg =~ s/\0//g;
     return if (length($shmmsg) == 0);
     if ($shmmsg =~ s/^(\S+):(\d+):(\d+): //) {
        my $n   = $1;
index cc6726565f47e090f1bef684fd6834e0d70ef614..ada60ce8113155e9c07a0e378c67793df0f403a1 100644 (file)
@@ -225,7 +225,7 @@ sub factstats {
 sub karma {
     my $target = lc( shift || $who );
     my $karma  = &sqlSelect("stats", "counter",
-       { nick => $target, type => "karma" }) || 0; 
+       { nick => $target, type => "karma" }) || 0;
 
     if ($karma != 0) {
        &pSReply("$target has karma of $karma");
@@ -330,7 +330,7 @@ sub tell {
     $target    = $talkchannel  if ($target =~ /^us$/i);
     $target    = $who          if ($target =~ /^(me|myself)$/i);
 
-    &status("tell: target = $target, query = $query");  
+    &status("tell: target = $target, query = $query");
 
     # "intrusive".
 #    if ($target !~ /^$mask{chan}$/ and !&IsNickInAnyChan($target)) {
@@ -416,7 +416,7 @@ sub DNS {
            $result = $match." is ".$x unless ($x =~ /^\s*$/);
        } else {
            $result = "I can't seem to find that address in DNS";
-        }
+       }
 
     } else {
 
index 9aef5f63b0266a8ca718208373a6ea990d92ae27..802e4c20a72da8c33dd51a4a3440f5ff4d42499d 100644 (file)
@@ -31,7 +31,7 @@ use vars qw(@joinchan @ircServers @wingateBad @wingateNow @wingateCache
 );
 
 ### hash. MUST BE REDUCED IN SIZE!!!
-# 
+#
 use vars qw(%count %netsplit %netsplitservers %flood %dcc %orig
            %nuh %talkWho %seen %floodwarn %param %dbh %ircPort
            %topic %moduleAge %last %time %mask %file
@@ -225,7 +225,7 @@ sub IsChanConf {
        return 0;
     }
 
-    # should we use IsParam() externally where needed or hack it in 
+    # should we use IsParam() externally where needed or hack it in
     # here just in case? fix it later.
     if (&IsParam($param)) {
        &DEBUG("ICC: found '$param' option in main config file.");
@@ -308,7 +308,7 @@ sub getChanConf {
        return 0;
     }
 
-    # this looks evil... 
+    # this looks evil...
     if (0 and !defined $chan) {
        &DEBUG("gCC: ok !chan... doing _default instead.");
     }
index 75464a164f0690a17ab29fe4f5350dce06bd3d0a..5071404081f3196205d72c7fd966e71c7bde0e3c 100644 (file)
@@ -558,7 +558,7 @@ sub searchTable {
     $str =~ s/\*/%/g;
     # end of string fix.
 
-    my $query = "SELECT $select FROM $table WHERE $key LIKE ". 
+    my $query = "SELECT $select FROM $table WHERE $key LIKE ".
                &sqlQuote($str);
     my $sth = $dbh->prepare($query);
 
index 05d22f38133a01e442d7c6a96795486002914b41..7de063a38d22f412a991e8926d387c041171cb03 100644 (file)
@@ -158,7 +158,7 @@ sub loadIRCModules {
            &ERROR("require \"$mod\" => $@");
            &shutdown();
            exit 1;
-        }
+       }
 
        $moduleAge{$mod} = (stat $mod)[9];
        &showProc(" ($_)") if (&IsParam("DEBUG"));
@@ -204,7 +204,7 @@ sub reloadAllModules {
 
     # obscure usage of map and regex :)
     foreach (map { s/.*?\/?src/src/; $_ } keys %moduleAge) {
-        $retval .= &reloadModule($_);
+       $retval .= &reloadModule($_);
     }
 
     &VERB("Module: reloading done.",2);
@@ -304,7 +304,7 @@ sub loadMyModule {
     my ($tmp) = @_;
     if (!defined $tmp) {
        &WARN("loadMyModule: module is NULL.");
-       return 0; 
+       return 0;
     }
 
     my ($modulename, $modulebase);
@@ -388,8 +388,8 @@ sub getPerlFiles {
     my($dir) = @_;
 
     if (!opendir(DIR, $dir)) {
-        &ERROR("Cannot open source directory ($dir): $!");
-        exit 1;
+       &ERROR("Cannot open source directory ($dir): $!");
+       exit 1;
     }
 
     my @mods;