http://qs321.pair.com?node_id=629993

gube has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,

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