import os, json
json.load(os.popen(
    """
perl -e '
  use POSIX qw(localtime asctime);
  use JSON qw(to_json);
  my @localtime = localtime(time);
  print to_json({localtime => \\@localtime,
                 asctime => asctime(@localtime)});
'
"""
    ))
How to call the perl function in Python