A reread through
perllol or
perlreftut might be helpful. When you use the syntax
$libs[$i]{'file'} it's actually short hand for
$libs[$i]->{'file'} since each element of
@libs is a hash reference. The error 'requires explicit package name' is because
$lib{'file'} is trying to access the 'file' element of the hash
%lib - the dereference cannot be done automatically due to potential syntactic ambiguity. What would work for you is:
1 foreach my $lib (@libs) {
2 my $file = $lib->{'file'};
3 print "reading $file\n";
4 }