#!/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 $file=''; while (my $line=<$fh>) { $file.=$line; } for my $n (1..3) { if ($file =~ m/\'hash$n\'.+?\{(.*?)\}/ms) { my $part=$1; my ($typ_s) = $part=~/\'paramA\'.*?\=\>.*?\'(.*?)\'/ms; my ($paramb)= $part=~/\'paramB\'.*?\=\>.*?\'(.*?)\'/ms; print "n $n typ_s $typ_s paramb $paramb\n"; } # part } # n } #### D:\goodies\pdhuck\down1\perl\monks>perl 1185438.pl n 1 typ_s 00 paramb FF n 2 typ_s 01 paramb 02 n 3 typ_s 00 paramb 03