Subject: | False-positive of Variables::ProhibitPunctuationVars when {} used in interpolated string |
Using a critic RC file that includes:
[Variables::ProhibitPunctuationVars]
allow = $@ $! $$ $0 $? $^O
The attached file generates a complaint at line 7:
Magic punctuation variable used in interpolated string at line 7, column
7. See page 79 of PBP. (Severity: 2)
It is complaining about the construct "${$}" used in the string, to
allow a literal trailing "_" (without interpreting this as dereferencing
$_). Note that the line above has "$$" and generates no complaint.
Randy
--
Randy J. Ray
rjray@blackperl.com
randy.j.ray@gmail.com
Subject: | test.pl |
#!/usr/bin/env perl
use strict;
use warnings;
print "This string contains the PID: $$\n";
print "This string contains the PID twice: ${$}_$$\n";
exit;