in reply to Sorting Days of Week Using today () to today () + 6
Just a couple of comments:
- WHERE calendar_desc = '$voy_cal2use': http://www.bobby-tables.com. Use What are placeholders in DBI, and why would I want to use them? instead.
- I could not find a declaration for $voy_cal2use.
- There is a lot of duplicated code. Quite a bit could be reduced by generating part of the SQL:
my $column_names = join( ",", map { ( "${_}_open", "${_}_openhour", "${_}_closehour" ); } map { lc( $_ ); } @day_text; my $sql = qq(SELECT $column_names ...);
- I would probably use a slightly different data structure and leverage the bind_col or bind_columns call from DBI instead of the block of $normal_hrs{$day}{$subkey} = ... calls.
No time yet to evaluate other things.
--MidLifeXis
In Section
Seekers of Perl Wisdom