#!/usr/bin/perl -w use strict; foreach my $configFilename (@ARGV) { if (open FH, '<', $configFilename) { &processConfigFile(); } } exit; __END__ C:\Steve\Dev\PerlMonks\P-2013-09-27@1720-Config-Parent>perl configParent.pl Bareword "LOADED_Lower::" refers to nonexistent package at configParent.pl line 32. Global symbol "$line" requires explicit package name at configParent.pl line 19. Global symbol "$line" requires explicit package name at configParent.pl line 21. Global symbol "$key" requires explicit package name at configParent.pl line 22. Global symbol "$line" requires explicit package name at configParent.pl line 24. Global symbol "$base_type" requires explicit package name at configParent.pl line 26. Global symbol "$line" requires explicit package name at configParent.pl line 28. Global symbol "%base" requires explicit package name at configParent.pl line 30. Global symbol "$base_type" requires explicit package name at configParent.pl line 30. syntax error at configParent.pl line 32, near "LOADED_Lower:: total_finish" Global symbol "%results" requires explicit package name at configParent.pl line 35. Global symbol "$key" requires explicit package name at configParent.pl line 35. Missing right curly or square bracket at configParent.pl line 39, at end of line configParent.pl has too many errors. #### #!/usr/bin/perl -w use strict; foreach my $configFilename (@ARGV) { if (open FH, '<', $configFilename) { &processConfigFile(); } } exit; sub processConfigFile { while( $line = ) { next unless $line =~ m<\s+(\S+)\sHOLDS\s(.+)>x; $key = $1; #Obtains first_distribution, etc if ($line =~ /(\S+_Lower)\sHOLDS\s\S+/i) { $base_type = $1; #obtains parent config ID (eg SWG_Lower ) while ($line =~ m<\s(\S+):\s(completion).+>gx) # obtaining attributes { push(@{$base{$base_type}}, $1);}} # push each attribute associated with parent ID into an hash of arrays # eg A dump from the hash looks like this which is correct SWG_Lower:: total_dist total_finish total_cancel LOADED_Lower:: total_finish, total_cancel : CONFIG_Lower: total_cancel next unless exists $results{$key}; # I do this incase there are distribution ids in the file which are not in my hash } __END__ C:\Steve\Dev\PerlMonks\P-2013-09-27@1720-Config-Parent>perl configParent.pl Bareword "LOADED_Lower::" refers to nonexistent package at configParent.pl line 32. Global symbol "$line" requires explicit package name at configParent.pl line 19. Global symbol "$line" requires explicit package name at configParent.pl line 21. Global symbol "$key" requires explicit package name at configParent.pl line 22. Global symbol "$line" requires explicit package name at configParent.pl line 24. Global symbol "$base_type" requires explicit package name at configParent.pl line 26. Global symbol "$line" requires explicit package name at configParent.pl line 28. Global symbol "%base" requires explicit package name at configParent.pl line 30. Global symbol "$base_type" requires explicit package name at configParent.pl line 30. syntax error at configParent.pl line 32, near "LOADED_Lower:: total_finish" Global symbol "%results" requires explicit package name at configParent.pl line 35. Global symbol "$key" requires explicit package name at configParent.pl line 35. Missing right curly or square bracket at configParent.pl line 39, at end of line configParent.pl has too many errors.