opendir ( SSPR , "/apps/inst1/metrica/TechnologyPacks/ON-SITE/summaryspr/") or die "$!"; while ( defined ( $file_name = readdir(SSPR) ) ) { next if ( -d $file_name ); # removing . and .. open ( FH , "/apps/inst1/metrica/TechnologyPacks/ON-SITE/summaryspr/$file_name" ) or die "$!"; $sspr_hash{$file_name} = []; @{$sspr_hash{$file_name}} = ; map { $_ =~ s/[\n\r]//g } @{$sspr_hash{$file_name}}; } #### # this loop is to analysed the schema from summary spr files foreach $file_name ( keys %sspr_hash ) { foreach $line ( @{$sspr_hash{$file_name}} ) { if ( grep ( /$old_schema/i, $line ) ) { print "$old_schema|$new_schema_str|$found_status|$migratestr|$rename_str|$file_name\n"; } } }