You need an eval to interpolate.my $line = "ABABABAB"; my $limit = 3; my $base = "A"; say "Yes 1" if $line =~ tr/$base/$base/ >= $limit; say "Yes 2" if eval "\$line =~ tr/$base/$base/" >= $limit; __END__ Yes 2
In reply to Re^2: searching characters
by JavaFan
in thread searching characters
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |