in reply to Some problem pattern matching

The reason for the "uninitialized" warnings is that you have an off-by-one error in your for loops. They attempt to go beyond the size of the array. You can prove this to yourself by printing the value of $a, for example, inside your outermost loop. The quickest fix is to change <= to <. For example, change:
for ($a=0; $a<= scalar(@abst_listing); $a++){

to:

for ($a=0; $a< scalar(@abst_listing); $a++){

A more Perl-ish way to create this for loop is as follows:

for my $a (0 .. $#abst_listing){

Notice that I declared the loop variable in the for statement itself. You should do the same for your b and c loops as well.

If you had shown some actual data, it would be easier to figure out why you are not getting the matches you expect. Perhaps some other tips in the Basic debugging checklist will help you. If your arrays contain metacharacters, perhaps you need to use quotemeta for your regular expressions. You could try to chomp your arrays, then simplify your regexes by removing the //m modifiers.

As a side note, your get_data sub is very similar to File::Slurp::read_file.

use lib'/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD/mys +ql.pm';
I don't think that does what you want. lib "is typically used to add extra directories to perl's search path", but you are trying to specify a module file. Perhaps this is what you meant:
use lib '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi';

Update: fixed typo (thanks amedico).

Replies are listed 'Best First'.
Re^2: Some problem pattern matching
by amedico (Sexton) on Apr 03, 2010 at 05:44 UTC
    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.
Re^2: Some problem pattern matching
by amedico (Sexton) on Apr 03, 2010 at 05:36 UTC
    Typo... I think you mean:

    for ($a=0; $a<scalar(@abst_listing); $a++){
Re^2: Some problem pattern matching
by eMBR_chi (Acolyte) on Apr 07, 2010 at 15:07 UTC

    Thank you very much. the codes do work well now. I handled the off-by-one error as advised. I also hadn't chomped the arrays earlier. Thanks a lot.