in reply to All files in dir to Storable.pm data

You call readdir, but you do not check that the name you get back is indeed a file. More specifically you want to skip . and ..

read_dir from File::Slurp will do that for you. Also Storabe has a sub to write the data directly to a file

use strict; use Storable; use File::Slurp; my %html_files = map { ($_, scalar read_file($_)) } read_dir("."); store(\%html_files, "brick");