in reply to Re: foreach problem
in thread foreach problem

Do what pray? The following code (without strictures)

my @libs = qw{1 2 3 4}; foreach my $lib (@libs) { my $file = $lib{'file'}; print "reading $file\n"; }

Prints:

reading reading reading reading

and with use strict added generates the error:

Global symbol "%lib" requires explicit package name at ... line 7. Execution of ... aborted due to compilation errors.

which is the 'requires explicit package name' that worried the OP (and quite rightly). The OP is using strictures and they have just saved his job/his marriage/his sanity/the world, or whatever. Good OP++!


True laziness is hard work