perl - Use of uninitialized value in concatenation (.) or string at App/DuckPAN/Web.pm line 484 -


i trying develop instant answer goodie duckduckgo. using codio , after testing code, when try run webserver @ port 5000, error:

ddg::zeroclickinfo  {                                                                                                                                                                                                                                      parents       www::duckduckgo::zeroclickinfo                                                                                                                                                                                                           public methods (4) : does, has_structured_answer, new, structured_answer                                                                                                                                                                               private methods (0)                                                                                                                                                                                                                                    internals: {                                                                                                                                                                                                                                               answer_type         "lowest_common_multiple",                                                                                                                                                                                                          caller              "ddg::goodie::lowestcommonmultiple",                                                                                                                                                                                               is_cached           1,                                                                                                                                                                                                                                 is_unsafe           0,                                                                                                                                                                                                                                 structured_answer   {                                                                                                                                                                                                                                      data        {                                                                                                                                                                                                                                              subtitle   "greatest common factor: 4, 20",                                                                                                                                                                                                            title      20                                                                                                                                                                                                                                      },                                                                                                                                                                                                                                                     templates   {                                                                                                                                                                                                                                              group   "text"                                                                                                                                                                                                                                     }                                                                                                                                                                                                                                                  }                                                                                                                                                                                                                                                  }                                                                                                                                                                                                                                                  }                                       use of uninitialized value in concatenation (.) or string @ /home/codio/perl5/perls/perl-5.18.2/lib/site_perl/5.18.2/app/duckpan/web.pm line 484.               

this lowestcommonmultiple.pm

package ddg::goodie::lowestcommonmultiple; # abstract: returns lowest common multiple of 2 numbers entered  use strict; use ddg::goodie; use math::bigint   zci answer_type => 'lowest_common_multiple'; zci is_cached   => 1;  triggers startend => 'lcm','lowest common multiple';  handle remainder => sub {   @numbers = grep(/^\d/, split /(?:\s|,)+/);  return unless @numbers > 1;      @numbers = sort { $a <=> $b } @numbers;     $formatted_numbers = join(', ', @numbers);     $result = $numbers[0] * $numbers[1] / math::bigint::bgcd(@numbers);      return  "lowest common multiple of $formatted_numbers $result.",     structured_answer => {       data => {        title => "$result",        subtitle => "lowest common multiple: $formatted_numbers"      },      templates => {        group => "text",     }     };   };  1; 


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -