#!/usr/bin/perl use warnings; use strict; use JSON; my $struct = { time => time, id => int rand 65536, }; while () { chomp; my ($key, $value, $format, $version) = split /,/; push @{ $struct->{data} }, { key => $key, value => $value, format => $format, version => $version, }; } my $jsonizer = JSON->new->pretty; print $jsonizer->encode($struct); __DATA__ first,1,1.5.6,5.4 two,2,1.4.6,5.4 five,5,1.5.9,5.1 #### ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,