Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jdavidb (1361)

jdavidb
  (email not shown publicly)
http://voiceofjohn.blogspot.com/

J. David Blackstone has a Bachelor of Science in Computer Science and Engineering and nine years of experience at a wireless telecommunications company, where he learned Perl and never looked back. J. David has an advantage in that he works really hard, he has a passion for writing good software, and he knows many of the world's best Perl programmers.

Journal of jdavidb (1361)

Wednesday November 06, 2002
12:03 PM

On concatenation

[ #8801 ]

I read that _ (the operator formerly known as .) has been changed to ~. I'm pretty happy about that; _ seems like a very expensive character to type, while I type ~'s all the time, and it seems much easier. Both still require the use of a shift, but ~ feels like it's much closer.

Of course, I still like .. Maybe there can be a syntax warping pragma for us . diehards.

I realize none of this makes any rational sense.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • * garghhhh *

    On a Swedish keyboard, the ~ is AltGraph-akey+Space. That's so we can produce chars like ã with the ~ on top of the a (we don't use that in Swedish, but still).

    Right now it's just annoying when writing urls with home directories. With ~ as a Perl operator, I'll have to bind it to a macro if I want to remain sane...

    /J

    • Sorry to hear that. I can see how it will be painful.

      Maybe with the Perl 6 syntax warping features we'll both be able to:

      {
        use concatenator '.';
        ...
      }

      Out of curiosity, I would expect that =~ gives you grief today, too? Maybe Swedish Perl programmers use $_ more often than others. :)

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
  • How about using what every other language uses for string concatenation: "+"

    As for the ease of the "~" key - not if you're on a Sun keyboard. :)

    • As for the ease of the "~" key - not if you're on a Sun keyboard. :)

      (Glances over at the blade I'm still not using more than this Linux box.) Ooh, you're right. Hadn't thought of that.

      Why is it the price of getting the control key in the "right" place on my keyboard is totally losing the ~ key?

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • Because in Perl, numbers and strings are easily interconverted. Just try:

      perl -e 'print "5"+"6"'

      and see what happens!

      In any case, the dot operator is wonderful, and I'm disappointed that it's being changed at all.
  • So now we'll have two similar but completely unrelated operators =~ and ~=. Hmm. Just like we already had <= and =>.
    • I think =~ is turning into ~~ in perl6, so you'll just have the pre-existing pair to disambiguate.

      -matt
    • I got my info from the latest Perl 6 summary, which also mentioned they were getting rid of (one of those...) for just that reason.

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers