fixes for new DDG (using strict)
parent
fbff1c8f31
commit
f7cd676c95
|
@ -1,2 +1,3 @@
|
|||
DDG-*
|
||||
.build
|
||||
*.sw*
|
||||
|
|
|
@ -21,7 +21,7 @@ handle query_lc => sub {
|
|||
}
|
||||
|
||||
if(scalar(@dates) == 6) {
|
||||
my $inclusive, $days1, $days2;
|
||||
my ($inclusive, $days1, $days2);
|
||||
|
||||
eval {
|
||||
$days1 = Date_to_Days(@dates[2,0,1]);
|
||||
|
|
|
@ -91,16 +91,16 @@ handle remainder => sub {
|
|||
my @string = split(//,reverse $_);
|
||||
my $flippedString;
|
||||
|
||||
foreach $char (@string) {
|
||||
for (@string) {
|
||||
|
||||
# Not all uppercase letters can be flipped
|
||||
$char = lc($char);
|
||||
$_ = lc;
|
||||
|
||||
if ( exists $charMap{$char}) {
|
||||
$flippedString .= $charMap{$char};
|
||||
if ( exists $charMap{$_}) {
|
||||
$flippedString .= $charMap{$_};
|
||||
}
|
||||
else {
|
||||
$flippedString .= $char;
|
||||
$flippedString .= $_;
|
||||
}
|
||||
}
|
||||
return $flippedString;
|
||||
|
|
|
@ -15,7 +15,7 @@ handle query_parts => sub {
|
|||
my @allwords = share('words.txt')->slurp;
|
||||
my @words;
|
||||
|
||||
foreach (@allwords) {
|
||||
for (@allwords) {
|
||||
chomp($_);
|
||||
if (length($_) == $length) { push(@words, $_); }
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ handle query_parts => sub {
|
|||
my @randomwords;
|
||||
if (scalar(@words) > 30) {
|
||||
while (scalar(@randomwords) < 30) {
|
||||
$rand = int(rand(scalar(@words)));
|
||||
my $rand = int(rand(scalar(@words)));
|
||||
if ($words[$rand]) {
|
||||
push(@randomwords, $words[$rand]);
|
||||
$words[$rand] = 0;
|
||||
|
|
Loading…
Reference in New Issue