See the below code. I declared one variable and assigned the name. For the same Code first time it's working and second time it's not working. What would be the reason ?
#!/usr/local/bin/perl use strict; use warnings; my $regexp = 'Perl Monks'; if($regexp =~ m/^Perl Monks/gi) { print "\nFound.."; } else { print "\nNot Found.."; } if($regexp =~ m/^Perl Monks/gi) { print "\nFound.1."; } else { print "\nNot Found.1."; }
Update : Title change as per ww suggesion
In reply to Re-use of a global match by gube
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |