in reply to Perl Context - concatenation operator

You've fallen foul of a deprecated perl feature, namely version strings (or v-strings). See perldata under the heading "Version Strings" for more information.

Basically, a string of digits interspersed with '.'s (and no whitespace), is different from a series of digits being concatenated.

This 1.2.3 is a version string and is equivalent to "\1\2\3".

This 1 . 2 . 3 is the concatenation of those three digits. Eg"123"


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Perl Context - concatenation operator
by gnoitall (Novice) on Dec 21, 2006 at 18:57 UTC
    Not to be pedantic, but the node you're pointing at doesn't mention version strings. The perldata node you cite is for version 5.6.1; the deprecation notice you mention seems to originate in 5.8.

    Nonetheless, a deprecated but poorly documented feature is a sure trap for the uninitiated. I'm not personally a total n00b, but I've never heard of vstrings. I think my editing habits (always quoting strings, for instance) have kept me from stumbling into this particular piece of syntactic sugar poison, but it doesn't take much imagination to see how it could happen.

      Not to be pedantic, but the node you're pointing at doesn't mention version strings. The perldata node you cite is for version 5.6.1;

      Yes, but ... the very first link on that page leads directly to the latest docs, and the second line warns that the PM local copy is out of date.

      Quite why the links don't just forward you to the appropriate place ... then a great gob of PM disk space could be recovered. Maybe it's because the "appropriate place" has a habit of changing. It was perldoc.org for a while, but that was down more often than a tart's knickers. It now seems to be perldoc.perl.org. There is probably a shortcut thingy to take you directly there, but I can never remember where to go to look them up!


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.