PERL Variable names, Significant Length

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robokevs009
    New Member
    • Aug 2009
    • 2

    PERL Variable names, Significant Length

    Hello everyone,

    I'm new to PERL and i just wanted to ask how many are the significant initial characters in naming a variable in PERL. I know that a variable has a maximum name length of 255, but how many of these are significant.

    In C for instance,
    <quote>
    63 significant initial characters in an internal identifier or a macro
    name (each universal character name or extended source character is
    considered a single character)
    — 31 significant initial characters in an external identifier
    < end quote>
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by robokevs009
    Hello everyone,

    I'm new to PERL and i just wanted to ask how many are the significant initial characters in naming a variable in PERL. I know that a variable has a maximum name length of 255, but how many of these are significant.

    In C for instance,
    <quote>
    63 significant initial characters in an internal identifier or a macro
    name (each universal character name or extended source character is
    considered a single character)
    — 31 significant initial characters in an external identifier
    < end quote>
    You should take a read of the perldata language reference page. It should answer your questions.

    Regards,

    Jeff

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      On my Vista 64 bit with strawberry perl 5.10 I can use a scalar with 257 characters (not including the $ at the beginning). At 258 I get the "identifier too long" error.

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Originally posted by KevinADC
        On my Vista 64 bit with strawberry perl 5.10 I can use a scalar with 257 characters (not including the $ at the beginning). At 258 I get the "identifier too long" error.
        He he, you tried it, didn't you? :)

        Comment

        • KevinADC
          Recognized Expert Specialist
          • Jan 2007
          • 4092

          #5
          Originally posted by numberwhun
          He he, you tried it, didn't you? :)
          I'm guilty. May I be punished now?

          Comment

          Working...