for my $directory (@directories) { # read all subdirs $hierarchy{$directory} = (); opendir DIR, $directory; for my $filename (readdir DIR) { # remove filename extension ($filename) = split('.', $filename); print $filename; push($hierarchy{$directory}, $filename); } closedir DIR; } #### Type of arg 1 to push must be array (not hash element) at admin.pl line 230, near "$filename)"