in reply to Year-month for file names
My code works but I am not sure if I am over doing it or if there would be a better and more straight forward way to accomplish the same thing more efficiently.
Your subroutine takes no parameters, so no variation is possible. In other words, why waste time generating this at runtime, the returned array is constant, so make it so:
use constant DB_DATES => [ qw[ file_name_201212 file_name_201301 file_name_201302 file_name_201303 file_name_201304 file_name_201305 file_name_201306 file_name_201307 file_name_201308 file_name_201309 file_name_201310 file_name_201311 ] ]; print for @{ DB_DATES() };; file_name_201212 file_name_201301 file_name_201302 file_name_201303 file_name_201304 file_name_201305 file_name_201306 file_name_201307 file_name_201308 file_name_201309 file_name_201310 file_name_201311
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Year-month for file names
by daxim (Curate) on Nov 26, 2013 at 15:19 UTC | |
by BrowserUk (Patriarch) on Nov 26, 2013 at 15:22 UTC | |
|
Re^2: Year-month for file names
by Anonymous Monk on Nov 26, 2013 at 14:53 UTC | |
by BrowserUk (Patriarch) on Nov 26, 2013 at 15:52 UTC |