If 0, 1, 2, 100 in the examples above were used more than once in your program, would you create a symbolic name for them?

Not for the uses in your examples.

I do use enums for 0 and 1 where they are indexes in multi-dimensional arrays with the 0th element being an X coordinate and 1 the Y coordinate; and similar examples.

This is the results of a grep for "enum" in *.pl files in my junk directory:

1031775.pl:use enum qw[ NAME FREQ LEFT RIGHT ]; 1161363.pl:use enum qw[ IN DBI ]; 1161647.pl:use enum qw[ IN DBI_ENUM ]; 1177385.pl:use enum qw[ IN DBI_ENUM ]; 904729-2.pl:use enum qw[ CODE GRAPH START PATH SEEN ]; 904729-3.pl: use enum qw[ CODE GRAPH START PATH SEEN ]; CIDR.pl:use enum qw[ CIDR NETWORK SIZE RANGE ]; CIDR.pl:use enum qw[ FIRST LAST ]; dumpTree.pl:use enum qw[ LEFT RIGHT ]; dumpTree.pl:use enum qw[ WIDTH DEPTH NAME ]; FPstuff.pl:use enum qw[ X Y ]; GraphBench.pl: use enum qw[ CODE GRAPH START END PATH ]; GraphBench.pl: use enum qw[ CODE GRAPH START END PATH ]; hFP.pl: use enum 'KEY', 'VAL'; lazyTree.pl:use enum qw[ LEFT RIGHT ]; philo3.pl:use enum qw[LEFT RIGHT ALL]; plotTSP.pl:use enum qw[ X Y ]; plotTSP2.pl:use enum qw[ X Y ]; plotTSP3.pl:use enum qw[ X Y ]; SameFringe.pl:use enum qw[ LEFT RIGHT ];

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^6: Perl vs Python revisited by BrowserUk
in thread Perl vs Python revisited by QuillMeantTen

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.