This fails, even though it should work. And this code works if i change this line:#!/usr/bin/perl -w use strict; sub FOO { return qw($bar $foobar); } my $foo = '$bar'; print "It matched!\n" if (grep /$foo/, FOO());
Which looks (to me) like /$foo/ is interpolating $foo twice. Why is this?my $foo = '\$bar';
In reply to Double Interpolation in // operator? by BlueLines
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |