in reply to Re^3: PERL Variable Name, Significant length
in thread PERL Variable Name, Significant length

The parser seems to have a hardcoded limitation of 256 characters.
Hmm, on my 5.10.0 on Linux the limit seems to be 257 (which works fine, from 258 on I get an error) - a strange limit indeed...

  • Comment on Re^4: PERL Variable Name, Significant length

Replies are listed 'Best First'.
Re^5: PERL Variable Name, Significant length
by BrowserUk (Patriarch) on Aug 08, 2009 at 00:42 UTC

    Checking more closely, it appears to be 255 including the sigil on my system. (Vista 64/AS 5.10.4 64-bit.)

    If you're sure it is different on your system, maybe the limitation is some CRT internal static buffer that varies with compiler?


    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".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Here is what I do:

      perl -e 'print "\$" . "x" x 257 . " = 1"' > 257.pl perl 257.pl
      This does not give an error. However:

      perl -e 'print "\$" . "x" x 258 . " = 1"' > 258.pl perl 278.pl Identifier too long at 258.pl line 1.
      So it seems that on my system (32-bit Ubuntu) 257 is indeed the limit ... very strange though that this should be platform-dependent.

        System differences then. At least 255 is an understandable limit :) 257 makes no sense at all.


        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".
        In the absence of evidence, opinion is indistinguishable from prejudice.