Perl hash to json conversion? -


i have coded crawler in perl to url, title of site , put hash following

   $var1 = {       'address1' => {                   'url' => 'dthree',                   'title' => 'done'                  },       'address2' => {                     'url' => 'dthree',                      'title' => 'done'                    }     }; 

then how can convert json format .. im using mojo::json

the first 4 lines in mojo::json's synopsis tell you.

use mojo::json; $json = mojo::json->new->encode( $var1 ); 

Comments