in reply to Re: Some problem pattern matching
in thread Some problem pattern matching

Also, an even better way to write the array loops is:
for my $cont_name (@cont_names) { # do stuff with $cont_name }
Rather than:
for ($c=0; $c < scalar(@cont_names); $c++) { # do stuff with $cont_names[$c] }
When you don't specifically need the index number, it's best to avoid it altogether. Not dealing with the array index number makes your code more readable, more maintainable, and less error-prone.