# HG changeset patch # User "Rex Tsai " # Date 1224336189 -28800 # Node ID 96ee35378696e977afb8772494ca6fd95ef429c8 # Parent 9466964ae5bbad49cc51fafa6e0a0c0ee90842da modified for searching configuration files diff -r 9466964ae5bb -r 96ee35378696 Ikariam.pm --- a/Ikariam.pm Fri Oct 17 14:06:31 2008 +0800 +++ b/Ikariam.pm Sat Oct 18 21:23:09 2008 +0800 @@ -1,7 +1,8 @@ #!/usr/bin/env perl BEGIN { - my $HOME = (getpwuid($<))[7] || $ENV{HOME} || $ENV{LOGDIR} || "."; - require "$HOME/.eagleeye.pm"; + foreach (((getpwuid($<))[7], $ENV{HOME}, $ENV{LOGDIR}, ".")) { + require "$_/.eagleeye.pm" if (-f "$_/.eagleeye.pm"); + } } use Class::DBI::AutoLoader ( diff -r 9466964ae5bb -r 96ee35378696 scan.pl --- a/scan.pl Fri Oct 17 14:06:31 2008 +0800 +++ b/scan.pl Sat Oct 18 21:23:09 2008 +0800 @@ -8,7 +8,10 @@ { my ($island, @cities) = @_; - die ("empty cities list.\n") if ($#cities == -1); + if ($#cities == -1) { + warn ("empty cities list.\n"); + return; + } foreach my $city (@cities) {