Sorry, I saw something that I thought worked:
use constant { SEC => 0, MIN => 1, HOUR => 2, MDAY => 3, MON => 4, YEAR => 5, WDAY => 6, YDAY => 7, ISDST => 8, };
Instead, it's just syntax sugar to declare multiple constants with one use constant statement.

I searched the doc on constant, and didn't see a good example, though

Dereferencing constant references incorrectly (such as using an array subscript on a constant hash reference, or vice versa) will be trapped at compile time.
implies that a hash constant can be created.

Here's how it's done:

use constant Books_I_Own => { "The Wit and Wisdom of Mark Twain" => 1, "Attack of the Deranged Mutant Killer Monster Snow Goons" => 1, "Unix Power Tools" => 1, }
and from the debugger
DB<2> x Books_I_Own 0 HASH(0x1c831b8) 'Attack of the Deranged Mutant Killer Monster Snow Goons' => 1 'The Wit and Wisdom of Mark Twain' => 1 'Unix Power Tools' => 1
...so it is possible to have a constant set, if a hash is a set.

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re^4: Fastest way to test membership in a constant set by QM
in thread Fastest way to test membership in a constant set by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.