in reply to qw "$string $string" doesn't interpolate

All the q operators means a personalized quote. So, q``, q~~, q//, q{}, q"", q'', are all the same, a personalized quote for ''. (that won't interpolate values)

Also qq``, qq~~, qq//, qq{}, qq"", qq'' are all the same, a personalized quote for "". (that will interpolate values)

So, what metters is the q operator, and not the char used to delimite the string.

Now qw means quote word, and again, qw``, qw{}, qw(), qw"", qw'', are all the same. a personalized quote word, that means: split(/\s+/,'a b c $x $y $z') , where interpolation doesn't exists and there's no place that says that exists interpolation for quote word.

So, what metters is the operator and not the char used with q, qq, qw, qr...

http://perldoc.com is your friend!

Graciliano M. P.
"Creativity is the expression of the liberty".

  • Comment on Re: qw "$string $string" doesn't interpolate

Replies are listed 'Best First'.
Re:x2 qw "$string $string" doesn't interpolate (qqw anyone?)
by grinder (Bishop) on Jun 12, 2004 at 14:54 UTC

    I dunno, there's an obvious conclusion to draw from all this:

    operatoracts oninterpolates
    qstringno
    qqstringyes
    qwwordno
    qqwwordyes

    ... except that the last row in bold doesn't exist. That would be pretty cool actually, there have been times when I would have liked to be able to do just that.

    Oh well, no-one ever claimed that Perl's operators were orthogonal.

    - another intruder with the mooring of the heat of the Perl

      I was just about to post the same question, and I see the question has already been asked.

      qqw needs to be part of the core, IMHO. It would also function (via accidential TIMTOWTDI-ness) as a split on space delimited strings... @tokens = qqw/$foo/;

Re^2: qw "$string $string" doesn't interpolate
by QM (Parson) on Jun 12, 2004 at 15:24 UTC
    gmpasso: Yes, all of your points are well made, but speak to the existing condition (including the [perdoc://] reference).

    What I want to discuss is Why?

    [And can I get my own personalized q* operators? That would be cool. Maybe qm(), for QM? ;^)]

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      What I want to discuss is Why?
      For me, this is one of the most annoying questions that get asked about the way things work in perl. You can ask it about ANYTHING, and the answers is alway one of:
      • Because Larry wanted it so
      • Because some patch by the perl5-porters made it so
      • Its a bug (doesn't apply if its documented -- documented bugs are features)
      • It doesn't matter why, that's the way it works, there is nothing to discuss :)
      [And can I get my own personalized q* operators? That would be cool. Maybe qm(), for QM? ;^)]
      Sure, why not? If you're talking about perl5, you need to use filters of course. If you're talking perl6, you'll have to check http://perl6.org (i don't recall off the top of my head).

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

      A reply falls below the community's threshold of quality. You may see it by logging in.