From: mitty Date: Tue, 5 Oct 2010 00:48:40 +0000 (+0000) Subject: * FIX: warning 'Use of uninitialized value $ARGV[0]' on non debug mode X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=17701049179fc597fba07ed0dba216a95a63b69a;p=lab.git * FIX: warning 'Use of uninitialized value $ARGV[0]' on non debug mode git-svn-id: https://lab.mitty.jp/svn/lab/trunk/twitter@64 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- diff --git a/twitterbot.pl b/twitterbot.pl index 7da7ec8..eb9079d 100755 --- a/twitterbot.pl +++ b/twitterbot.pl @@ -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";