[ {information => { text => 'dir_A', data => { size => 99, type => 'folder' }, contents => [ { text => 'file_B', data => { size => 99, type => 'file' } }, { text => 'dir_C', data => { size => 99, type => 'folder' }, contents => [ { text => 'file_D', data => { size => 99, type => 'file' } }, { text => 'dir_E', data => { size => 99, type => 'folder' }, contents => [ { text => 'file_F', data => { size => 99, type => 'file' } } ] }, { text => 'file_G', data => { type => 'file', size => 99 } } ] }, { text => 'file_H', data => { type => 'file', size => 99 } } ] } } ] #### my $arrayref = _directoryTree('/usr/local/bin','/usr/local'); #### get => 'directory_list' sub { my $self = shift; my $arrayref = _directoryTree('/usr/local/bin','/usr/local'); $self->render(json => $arrayref); };