<?xml version="1.0" encoding="windows-1252"?>
<node id="269206" title="Re: Re: /o is dead, long live qr//!" created="2003-06-26 08:08:36" updated="2005-08-13 14:20:01">
<type id="11">
note</type>
<author id="194920">
diotalevi</author>
<data>
<field name="doctext">
&lt;p&gt;Yes and? Your qr// expression interpolated and then fixed the constant into place. Normally I'd just eschew that as a particularly ugly form of a regex though. In fact, I'd likely have written that as this instead. I'd be using the constant like its intended (as in, not like a cleverly named function) and I still get something reasonable. Now other people like [Perrin] have been convincing me that [cpan://constant] isn't all that great anyway especially given the bareword quoting rules with the =&gt; fat comma and interpolation (like you noticed).&lt;/p&gt;&lt;code&gt;use constant FOO =&gt; 'bar';
my $x = FOO;
$x = qr/$x/;

"somehting" =~ $x&lt;/code&gt;&lt;p&gt;So actually, I wouldn't have written it at all like that. This is more likely. Though I wouldn't have gone out of my way to create a qr// object if I was only going to use it in one place anyway. That looks like something that'd be better written as merely &lt;code&gt;"something" =~ $FOO&lt;/code&gt;.&lt;/p&gt;&lt;code&gt;our $FOO = 'bar';
my $x = qr/$FOO/;

"something" =~ $x;&lt;/code&gt;</field>
<field name="root_node">
269035</field>
<field name="parent_node">
269204</field>
</data>
</node>
