use Getopt::Long;
use Anime::ANN;
-GetOptions(\%options, ("l=s", "b=s"));
+GetOptions(\%options, "l=s", "b=s") || exit 1;
if($options{"l"}) {
@list = Anime::ANN::getlist($options{"l"});
}
if($options{"b"}) {
- exec "htmlview", Anime::ANN::geturl(Anime::ANN::getid $options{"b"});
+ $id = Anime::ANN::getid $options{"b"};
+ if(defined($id)) {
+ exec "htmlview", Anime::ANN::geturl($id);
+ } else {
+ printf STDERR "could not find " . $options{"b"} . "\n";
+ exit 1;
+ }
}
if(!defined($ARGV[0])) {
print ((" " x $ind) . "$i: " . $ref->[$i] . "\n");
refdump($ref->[$i], $ind + 1) if ref $ref->[$i];
}
+ } elsif(ref $ref eq "SCALAR") {
+ print ((" " x $ind) . $$ref . "\n");
} else {
print ((" " x $ind) . "Unknown ref: $ref\n");
}