Commits

Shlomi Fish  committed 3c60d0a

Got rid of &function(...) calls in BotModule/Infobot.pl.

In the process, I had to rename the functions which had the same
name as Perl built-ins.

  • Participants
  • Parent commits 393c08c
  • Tags get-rid-of-subroutines-called-with-ampserands

Comments (0)

Files changed (1)

File BotModules/Infobot.pl

 use Fcntl;
 
 if (not @ARGV == 2) {
-    &use();
+    display_usage();
 } else {
     my $command = shift @ARGV;
     my $filename = shift @ARGV;
+
     if ($command eq '-d') {
-        &dump($filename);
+        dump_file($filename);
     } elsif ($command eq '-i') {
-        &import($filename);
+        import_from_file($filename);
     } else {
-        &use();
+        display_usage();
     }
 }
 
-sub use {
+sub display_usage {
     print "\n";
     print "  usage:  $0 -d dbname\n";
     print "          prints out an ascii flat file of the database listed.\n";
     exit(1);
 }
 
-sub dump {
+sub dump_file {
     my %db;
     tie(%db, 'AnyDBM_File', shift, O_RDONLY, 0666);
     while (my ($key, $val) = each %db) {
     }
 }
 
-sub import {
+sub import_from_file {
     my %db;
     tie(%db, 'AnyDBM_File', shift, O_WRONLY|O_CREAT, 0666);
     while (<STDIN>) {