Re: pattern matching regex

2011-09-27 Thread Shawn H Corey
On 11-09-27 05:30 PM, Chris Stinemetz wrote: Trying to match the what is contained in $what 3 consecutive times. But I am getting the followoing error: Use of uninitialized value $_ in pattern match (m//) at ./ex9-1.pl line 7. The program: #!/usr/bin/perl use warnings; use strict; my $what

pattern matching regex

2011-09-27 Thread Chris Stinemetz
Trying to match the what is contained in $what 3 consecutive times. But I am getting the followoing error: Use of uninitialized value $_ in pattern match (m//) at ./ex9-1.pl line 7. The program: #!/usr/bin/perl use warnings; use strict; my $what = 'fred|barney'; if (/($what){3}/) { print $wha