Help for this page

Select Code to Download


  1. or download this
      package mylib::json;
      use Exporter 'import';
    ...
        eval { $j = JSON::XS->new->encode($o); };
        return $@ ? undef : $j;
      }
    
  2. or download this
      package mylib;
      use Exporter 'import';
      use lib 'mylib';
      use mylib::json;
      our @EXPORT = ( @mylib::json::EXPORT );
    
  3. or download this
      use strict;
      use warnings;
      use lib '.';
      use mylib;
      print jsonEncode({foo => 'bar'});
    
  4. or download this
      use strict;
      use warnings;
    ...
      use mylib;
      use JSON::WebToken;
      print jsonEncode({foo => 'bar'});
    
  5. or download this
    Attempt to call undefined import method with arguments ("encode_json" 
    +...) via package "JSON" (Perhaps you forgot to load the package?) at 
    +C:/Strawberry/perl/site/lib/JSON/WebToken.pm line 12.