Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: directory tree to hash of arrays

by Kenosis (Priest)
on Mar 08, 2014 at 00:27 UTC ( [id://1077473]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    push @{ $hash{$currDir} }, { name => $_, size => ( stat($_) )[7] } for
    + <*>;
    my $j = encode_json \%hash;
    print $j;
    
  2. or download this
    {"/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}]}
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1077473]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-20 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found