Tips: Smartmatch (~~) is experimental, it is advised to not use it until the behaviour is better defined : http://search.cpan.org/dist/perl-5.18.0/pod/perldelta.pod#The_smartmatch_family_of_features_are_now_experimental (#4424)
parent
e41b5cc966
commit
7b0f4c1fa3
|
@ -5,7 +5,6 @@ use strict;
|
|||
use DDG::Goodie;
|
||||
with 'DDG::GoodieRole::NumberStyler';
|
||||
|
||||
|
||||
my @generic_trigs = ('tip calculator', 'calculate tip', 'tips calculator', 'calculate tips', 'bill tip', 'tip cost');
|
||||
triggers any => @generic_trigs;
|
||||
triggers any => 'tip', 'tips', 'of';
|
||||
|
@ -19,7 +18,8 @@ handle query_lc => sub {
|
|||
|
||||
# sets up the vanilla UI with default values
|
||||
# no values should be pased to the front-end
|
||||
if($_ ~~ @generic_trigs) {
|
||||
my $query = $_;
|
||||
if(grep { $_ eq $query } @generic_trigs) {
|
||||
return '', structured_answer => {
|
||||
data => {
|
||||
title => "Tip Calculator",
|
||||
|
@ -66,4 +66,4 @@ handle query_lc => sub {
|
|||
}
|
||||
};
|
||||
|
||||
1;
|
||||
1;
|
||||
|
|
Loading…
Reference in New Issue