in reply to Re: Unique visits - Webserver log parser
in thread Unique visits - Webserver log parser

In place of
use constant IP => 0; use constant AUTH => 1; use constant DATE => 2; use constant REQUEST => 3; use constant STATUS => 4; use constant BYTES => 5; use constant REFERER => 6; use constant UA => 7; use constant METHOD => 8; use constant URI => 9;
you can put this (after installing enum):
use enum qw(IP AUTH DATE REQUEST STATUS BYTES REFERER UA METHOD URI);
Much nicer and less chance of making a mistake.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: ?Enumerated lists (was Re: Re: Unique visits - Webserver log parser)
by Matts (Deacon) on Feb 27, 2002 at 16:22 UTC
    True enough... Why isn't enum.pm shipping with Perl 5.8??? It seems an ideal candidate to me. I didn't use it because I don't have it installed, though I have been looking at it lately because the code I'm refactoring has a lot of enum-like constants in it.

    Time to fire off an email to jarkko methinks.

    Update: cool, Jarkko has put it on the TODO list for 5.9.