Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    use strict;
    use warnings;
    ...
               $_->{pop},
               $_->{condition};
    }
    
  2. or download this
    C:>weather.pl
    Enter city or zip code (Xxxxx): Xxxxx
    
    ...
    
    Time      TempF TempC Rain %  Conditions
    malformed JSON string, neither array, object, number, string or atom, 
    +at character offset 0 (before "(end of string)") at C:/Perl/site/lib/
    +WWW/Wunderground/API.pm line 113.
    
  3. or download this
    $self->raw($result);
    
        if ($format !~ /(json|xml)/) {
    ...
        my $struc = $format eq 'json'   # <--- LN 113 here
          ? decode_json($self->raw)
          : XMLin($self->raw);