In which case a word must be something other than a sequence of "word characters". Is word defined somewhere?

update: I'm guessing a word must begin with an alphabetic character or an underscore so that anything beginning with a digit is not a word.

update: Looking at perl source (toke.c) it appears that anything beginning with a digit is scanned as a number while anything starting with an underscore or alphabetic character other than 'v' or 'x' is scanned as... there are quite a few possibilities here, one of which is "a word before a => operator". There is some additional testing done for 'v' and 'x'. I don't follow it all, but suspect 'v' might be the start of a version string, handled somewhat differently, and 'x' followed by a digit might be a repeat operator, depending on context. Otherwise 'v' and 'x' are handled the same as all the other alphabetics.

In conclusion: it appears that a word is not any sequence of word characters, but only those that begin with underscore or an alphabetic character. Anything beginning with a digit is a number, not a word, and is not forced to be a string when on the left of '=>'.


In reply to Re^4: Illegal octal digit error by ig
in thread Illegal octal digit error by lakshmananindia

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.