Don't use global variables:
print( test_reg('fudge','fudge') ? "matches\n" : "no matches\n" ); sub test_reg { my $this = shift; my $that = shift; return $this =~ /$that/i; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Strange behaviour of m and $_
by jeffa
in thread Strange behaviour of m and $_
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |