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

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.
RIP PCW
  • Comment on Re^5: PERL Variable Name, Significant length

Replies are listed 'Best First'.
Re^6: PERL Variable Name, Significant length
by morgon (Priest) on Aug 08, 2009 at 01:00 UTC
    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.