Help for this page
use strict; use warnings; ... push @{ $hash{$currDir} }, { name => $_, size => ( stat($_) )[7] } for + <*>; my $j = encode_json \%hash; print $j;
{"/home/user/programming/Perl/tmp":[{"name":"File1.txt","size":63},{"n +ame":"File2.txt","size":55},{"name":"temp5.pl","size":196},{"name":"t +est.pl","size":197}]}