* FIX: warning 'Use of uninitialized value $ARGV[0]' on non debug mode
authormitty <mitty@7d2118f6-f56c-43e7-95a2-4bb3031d96e7>
Tue, 5 Oct 2010 00:48:40 +0000 (00:48 +0000)
committermitty <mitty@7d2118f6-f56c-43e7-95a2-4bb3031d96e7>
Tue, 5 Oct 2010 00:48:40 +0000 (00:48 +0000)
git-svn-id: https://lab.mitty.jp/svn/lab/trunk/twitter@64 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

twitterbot.pl

index 7da7ec8..eb9079d 100755 (executable)
@@ -14,8 +14,9 @@ use FindBin qw($Bin);
 use YAML::Tiny;
 use Date::Parse qw(str2time);
 
-sub VERBOSE () { $ARGV[0] eq 'verbose' };
-sub DEBUG   () { VERBOSE or $ARGV[0] eq 'debug' };
+my $_execmode = $ARGV[0] || 0;
+sub VERBOSE () { $_execmode eq 'verbose' };
+sub DEBUG   () { VERBOSE or $_execmode eq 'debug' };
 use Data::Dumper;
 
 DEBUG and warn "$0: debug mode";