I fail to see how below answer is 1? can someone explain this for me?
DB<3> $string = "The cat sat on the mat";
DB<4> $animal = ($string =~ m/The (.*) sat/);
DB<5> print $animal;
1
I fail to see how below answer is 1? can someone explain this for me?
DB<3> $string = "The cat sat on the mat";
DB<4> $animal = ($string =~ m/The (.*) sat/);
DB<5> print $animal;
1
This behaviour is explained in the perlop manpage for m// binding in scalar context:
http://www.annocpan.org/~NWCLARK/perl-5.8.8/pod/perlop.pod\#256
thank you...