in reply to foreach within a foreach

You should take a look at your SQL.
You might want to join your employee table
and your emp_name table. Also you could avoid
looping over @days by changing your where
clause to have something like this in it
 AND wkday in ( 'Mon', 'Tue', 'Wed', 'Thu', 'Fri')

Replies are listed 'Best First'.
Re: Re: foreach within a foreach
by Spenser (Friar) on Jun 07, 2002 at 21:51 UTC

    That "IN" is a good idea.  I tried it just now and it helped to cut down on a lot of code, but eliminating one layer of my foreach statements caused other problems.

    I think have so much else going on in this script and even within the two foreach loops (lots of stuff that I left out of the posting) that it would be too much to unravel.  I may go back later and use it on this script.  I especially would like to adjust some other scripts that I created with this "IN" command.  I wasn't happy with the awkwardness of the code that I created by doing loops within loops.

    I've been learning that a good mySQL statement can significantly cut down on a lot of Perl coding and speed up the programming process. Thanks for the tip.

    That's Spenser, with an "s" like the detective.