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)

master
Rob Emery 2017-08-14 10:06:37 +01:00 committed by PJ Hampton
parent e41b5cc966
commit 7b0f4c1fa3
1 changed files with 3 additions and 3 deletions

View File

@ -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;