package main; use cacher "/etc"; my $fstab_wc = cacher::wc("fstab"); #### package cacher; use strict; use warnings; use warnings FATAL => qw{ uninitialized }; # larry, this should have been part of warnings. ... BEGIN { my %cachehash; my @saved_pkg_args; sub import { ... pick off the arguments, here /etc/ ... ... allow for a default ... ... how?? ... } use File::Glob qw(bsd_glob); foreach my $dir (bsd_glob(@saved_pkg_args, !"GLOB_NOCHECK")) { foreach my $file (bsd_glob("$dir/*")) { $cachehash{"$dir/$file"} = `wc $dir/$file`; } } sub wc { return($cachehash{$_[0]}); } }