in reply to Regex - counting number of '|'
tr doesn't do double quote interpolation, and this is documented. If you want it you've got to use eval:
my $count; eval qq{ \$count = \$inp_row =~ tr/$de/$de/; }; die "Problem in eval'd tr: $@\n";
Update: Bah, that wasn't directly to it. Direct link to the relevant section in perlop: tr///. Specifically you want the paragraph starting "Because the transliteration table is built at compile time . . .".
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|