title: Does Perl have an enumeration type?
body: <p>Does Perl have an enumeration type <em>that adheres to best practices</em>, or maybe more importantly, does it need one?</p>
  
  <p>The project I am working one uses strings all over the place to denote things that would typically use an Enum in a language like C#.  For example, we have a set of phone numbers in an array of hashes, each associated with a phone type ("Home", "Work", "Mobile", etc.):</p>
  
  <pre><code>$phone_number-&gt;{type} = 'Home';
  </code></pre>
  
  <p>Would it be sufficient to use a read-only set of variables here or should an Enum be used?  I've found an <a href="http://search.cpan.org/perldoc/enum" rel="noreferrer"><code>enum</code> module on CPAN</a> but it appears to use bare words which violates one of the <a href="http://oreilly.com/catalog/9780596001735/" rel="noreferrer">Perl Best Practices</a>.  My thinking on using <a href="http://search.cpan.org/perldoc/Readonly" rel="noreferrer">read-only variables</a> goes something like this:</p>
  
  <pre><code>use Readonly;
  
  Readonly my $HOME   =&gt; 'Home';
  Readonly my $WORK   =&gt; 'Work';
  Readonly my $MOBILE =&gt; 'Mobile';
  
  $phone_number-&gt;{type} = $HOME;
  </code></pre>
  
  <p>Is this a good approach or is there a better way?</p>