perl version redone for JSON

SWASS is going JSON. The Perl version of swass-gen has been fixed as a
result.