package hash; use strict; use warnings; $test = { 'hash1' => { 'paramA' => '00' , 'paramB' => 'FF' , }, 'hash2' => { 'paramA' => '01' , 'paramB' => '02' , }, 'hash3' => { 'paramA' => '00' , 'paramB' => '03' , }, }; #### #!/usr/local/bin/perl use strict; use warnings; Generate(); sub Generate { Process_File('hash.pm'); } sub Process_File { my $filename = shift; open(my $fh, '<:encoding(UTF-8)', $filename) or die "Could not open file '$filename' $!"; my $line; $line =~ m/\'hash1\'/; my $typ_s = $line->{paramA}; my $paramB = $line->{paramB}; print "$typ_s"; }