CGI-Application-Search
view release on metacpan or search on metacpan
lib/CGI/Application/Search.pm view on Meta::CPAN
if (!$file) {
warn "AUTO_SUGGEST_FILE was not specified!";
return [];
} elsif (!-r $file) {
warn "AUTO_SUGGEST_FILE $file is not readable!";
return [];
}
# if we are going to use the cache (meaning we want to use
# it and there's up-to-date data in there)
my $file_mod_time = (stat($file))[9];
if ( $want_to_cache
and @SUGGEST_CACHE
and $SUGGEST_CACHE_TIME >= $file_mod_time)
{
foreach my $cached (@SUGGEST_CACHE) {
# if it starts with this $word
if (index($cached, lc $word) == 0) {
push(@suggestions, $cached);
( run in 1.552 second using v1.01-cache-2.11-cpan-49f99fa48dc )