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

Well, I don't know which came first, but here is something to note:

qw is commonly used to pass in a list of things to import when using a module that extends Exporter. Most often Exporter is used to allow the import of subs, but can also be used to Export/Import variables. So, if the module Foo allowed the import of %h and $s, I might say:

use Foo qw/$s %h/;

And, if I really wanted interpolation, I would just use () instead of qw(), as mentioned above.

But I will agree that qw"" looks like it should interpolate. But, by definition, qw effectively does a split /\s+/ on the string. If qw"" did interpolate, should it split before the interpolation or after? This uncertainty may be why the never implemented interpolation in the first place.

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