On 7/31/2003 12:42 PM, Moreno, Javier (GXS, Softtek) wrote:

Hi all,

I was doing a date formatting function and did this:

        my %number_to_long_month = (
                 '1' => 'January',
                 '2' => 'February',
                 '3' => 'March',
                 '4' => 'April',
                 '5' => 'May',
                 '6' => 'June',
                 '7' => 'July',
                 '8' => 'August',
                 '9' => 'September',
                '10' => 'October',
                '11' => 'November',
                '12' => 'December'
        );

However I took a peek at CPAN to see if there was something that could aide
me, and found this:

@MoY = qw(January February March April May June
          July August September October November December);

What would be more efficient?

Regards,

Javier Moreno

Arrays are generally faster, and in this case, it actually makes more sense to use an array.


Note: There are /a lot/ of date manipulation modules on CPAN; notably the DateTime modules which are slated to be part of the perl core in the near future.

Randy.

--
A little learning is a dang'rous thing;
Drink deep, or taste not the Pierian spring;
There shallow draughts intoxicate the brain;
And drinking largely sobers us again.
                - Alexander Pope


_______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to