diff --git a/lib/DDG/Goodie/CalendarConversion.pm b/lib/DDG/Goodie/CalendarConversion.pm index 06c7e4213e9..9acf9a56c78 100644 --- a/lib/DDG/Goodie/CalendarConversion.pm +++ b/lib/DDG/Goodie/CalendarConversion.pm @@ -8,7 +8,7 @@ with 'DDG::GoodieRole::Dates'; use Date::Hijri; use Date::Jalali2; -use YAML qw(Load); +use YAML::XS 'LoadFile'; zci answer_type => "calendar_conversion"; zci is_cached => 0; @@ -25,7 +25,7 @@ attribution github => ['http://github.com/mattlehning', 'mattlehning'], triggers any => 'hijri', 'gregorian', 'jalali'; -my $calendars = Load(scalar share('calendars.yml')->slurp); +my $calendars = LoadFile(share('calendars.yml')); my $datestring_regex = datestring_regex(); diff --git a/lib/DDG/Goodie/DuckDuckGo.pm b/lib/DDG/Goodie/DuckDuckGo.pm index 59ebc302d4f..bdc55ad275f 100644 --- a/lib/DDG/Goodie/DuckDuckGo.pm +++ b/lib/DDG/Goodie/DuckDuckGo.pm @@ -4,7 +4,7 @@ package DDG::Goodie::DuckDuckGo; use strict; use DDG::Goodie; -use YAML qw( Load ); +use YAML::XS 'LoadFile'; primary_example_queries 'duckduckgo help'; secondary_example_queries 'ddg tor', 'short URL for duck duck go'; @@ -22,7 +22,7 @@ triggers any => @ddg_aliases, "zeroclickinfo", "private search"; zci is_cached => 1; -my $responses = Load(scalar share("responses.yml")->slurp); +my $responses = LoadFile(share('responses.yml')); # The YAML is intended to be human-friendly. # Now we make something computer-friendly. diff --git a/lib/DDG/Goodie/HelpLine.pm b/lib/DDG/Goodie/HelpLine.pm index b35728a6a14..9f6434cbff1 100644 --- a/lib/DDG/Goodie/HelpLine.pm +++ b/lib/DDG/Goodie/HelpLine.pm @@ -4,9 +4,9 @@ package DDG::Goodie::HelpLine; use strict; use DDG::Goodie; -use YAML::XS qw( Load ); +use YAML::XS 'LoadFile'; -my $triggers = Load(scalar share('triggers.yml')->slurp); +my $triggers = LoadFile(share('triggers.yml')); triggers any => @$triggers; @@ -21,7 +21,7 @@ topics 'everyday'; category 'special'; source 'https://en.wikipedia.org/wiki/List_of_suicide_crisis_lines'; -my $helplines = Load(scalar share('helplines.yml')->slurp); +my $helplines = LoadFile(share('helplines.yml')); my %suicide_phrases = map { $_ => 1 } @$triggers; handle query_lc => sub { diff --git a/lib/DDG/Goodie/Jira.pm b/lib/DDG/Goodie/Jira.pm index 62f58ff1aba..1da5af399d9 100644 --- a/lib/DDG/Goodie/Jira.pm +++ b/lib/DDG/Goodie/Jira.pm @@ -8,7 +8,7 @@ use utf8; zci is_cached => 1; zci answer_type => 'jira'; -use YAML qw( Load ); +use YAML::XS 'LoadFile'; primary_example_queries 'SOLR-4530'; secondary_example_queries 'IdentityHtmlMapper solr-4530'; @@ -21,7 +21,7 @@ attribution github => ['https://github.com/arroway', 'Stéphanie Ouillon'], twitter => ['http://twitter.com/steph_ouillon', 'Stéphanie Ouillon']; -my $projects = Load(scalar share('projects.yml')->slurp); +my $projects = LoadFile(share('projects.yml')); my @all_project_keys = sort keys %$projects; diff --git a/lib/DDG/Goodie/POTUS.pm b/lib/DDG/Goodie/POTUS.pm index 09edf6041de..5ae544fe312 100644 --- a/lib/DDG/Goodie/POTUS.pm +++ b/lib/DDG/Goodie/POTUS.pm @@ -5,7 +5,7 @@ use strict; use DDG::Goodie; use Lingua::EN::Numbers::Ordinate qw(ordsuf ordinate); use Lingua::EN::Words2Nums; -use YAML::XS qw( Load ); +use YAML::XS 'LoadFile'; triggers startend => 'potus'; triggers any => 'president of the united states', 'president of the us'; @@ -22,7 +22,7 @@ code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD attribution github => ['numbertheory', 'John-Peter Etcheber'], twitter => ['jpscribbles', 'John-Peter Etcheber']; -my @presidents = @{Load(scalar share('presidents.yml')->slurp)}; +my @presidents = @{LoadFile(share('presidents.yml'))}; my $prez_count = scalar @presidents; handle remainder => sub { diff --git a/lib/DDG/Goodie/Paper.pm b/lib/DDG/Goodie/Paper.pm index 3991ba66b63..a67b3e9f810 100644 --- a/lib/DDG/Goodie/Paper.pm +++ b/lib/DDG/Goodie/Paper.pm @@ -3,7 +3,7 @@ package DDG::Goodie::Paper; use strict; use DDG::Goodie; -use YAML; +use YAML::XS 'LoadFile'; zci answer_type => "paper"; zci is_cached => 1; @@ -22,7 +22,7 @@ attribution github => ['loganom', 'Logan McCamon'], twitter => ['loganmccamon', 'Logan McCamon'], github => ['mattlehnig', 'Matt Lehnig']; -my $sizes = Load(scalar share('sizes.yml')->slurp); +my $sizes = LoadFile(share('sizes.yml')); handle query_lc => sub { return unless my ($s, $l, $n) = $_ =~ /^((?:(a|b|c)(\d{0,2}))|legal|letter|junior\s*legal|ledger|tabloid|hagaki)\s+paper\s+(?:size|dimm?ensions?)$/i; diff --git a/lib/DDG/Goodie/PeriodicTable.pm b/lib/DDG/Goodie/PeriodicTable.pm index 53777c8ef7c..c5db0103bc6 100644 --- a/lib/DDG/Goodie/PeriodicTable.pm +++ b/lib/DDG/Goodie/PeriodicTable.pm @@ -3,7 +3,7 @@ package DDG::Goodie::PeriodicTable; use strict; use DDG::Goodie; -use YAML::XS qw(Load); +use YAML::XS 'LoadFile'; use List::Util qw(first); use Text::Trim; @@ -20,7 +20,7 @@ code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD attribution github => [ 'zblair', 'Zachary D Blair' ], github => ['skywickenden', 'Sky Wickenden']; -my @elements = @{ Load( scalar share('elements.yml')->slurp ) }; +my @elements = @{ LoadFile(share('elements.yml')) }; # Triggers my @element_triggers = [map { lc($_->[2]) } @elements]; diff --git a/lib/DDG/Goodie/PublicDNS.pm b/lib/DDG/Goodie/PublicDNS.pm index 356832539e9..ced2200e1b1 100644 --- a/lib/DDG/Goodie/PublicDNS.pm +++ b/lib/DDG/Goodie/PublicDNS.pm @@ -5,7 +5,7 @@ use strict; use DDG::Goodie; use List::Util qw(max); -use YAML qw( Load ); +use YAML::XS 'LoadFile'; primary_example_queries 'public dns'; description 'list common public DNS servers and their IP addresses'; @@ -21,7 +21,7 @@ triggers end => "public dns", "dns server", "dns servers"; zci is_cached => 1; zci answer_type => "public_dns"; -my $providers = Load(scalar share('providers.yml')->slurp); +my $providers = LoadFile(share('providers.yml')); my @ordered_servers; # Alphabetize the output while making the structure diff --git a/lib/DDG/Goodie/SolarSystem.pm b/lib/DDG/Goodie/SolarSystem.pm index cdcec408e0b..e0fcd0e105c 100644 --- a/lib/DDG/Goodie/SolarSystem.pm +++ b/lib/DDG/Goodie/SolarSystem.pm @@ -2,7 +2,7 @@ package DDG::Goodie::SolarSystem; # ABSTRACT: Return various attributes of a object use DDG::Goodie; -use YAML::XS qw( Load ); +use YAML::XS 'LoadFile'; use POSIX; use Text::Trim; use strict; @@ -32,7 +32,7 @@ my $unitsString = join('|', @unitTriggers); triggers any => 'earth', 'jupiter', 'mars', 'mercury', 'neptune', 'saturn', 'uranus', 'venus', 'pluto', 'sun', 'moon'; # Load object data -my $objects = Load(scalar share('objects.yml')->slurp); +my $objects = LoadFile(share('objects.yml')); # Handle statement handle query_lc => sub { diff --git a/lib/DDG/Goodie/ZappBrannigan.pm b/lib/DDG/Goodie/ZappBrannigan.pm index 4fa2faf7795..7f74a25e7a8 100644 --- a/lib/DDG/Goodie/ZappBrannigan.pm +++ b/lib/DDG/Goodie/ZappBrannigan.pm @@ -4,7 +4,7 @@ package DDG::Goodie::ZappBrannigan; use strict; use DDG::Goodie; -use YAML::XS qw(Load); +use YAML::XS 'LoadFile'; triggers any => "zapp", "brannigan"; @@ -21,7 +21,7 @@ code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DD category 'entertainment'; topics 'entertainment'; -my $quotes = Load(scalar share('quotes.yml')->slurp); +my $quotes = LoadFile(share('quotes.yml')); handle query => sub { return unless $_ =~ m/quotes?/;