in reply to Re: How to access the hash array values?
in thread How to access the hash array values?
Full code below
oem.min contains SRCPATH = "${BUILD_ROOT}/multimedia/graphics/apps/OEM/src" #!/usr/bin/perl -w use strict; use warnings; my @folders= ("oem"); my @array=("./oem.min"); my $folder; my %files_content; my %grep_lines; my ($file,$filename,$mk); foreach $file (@array) { chomp($file); open my $fh, '<',"$file" or die "could not open '$file' $!"; my @file_lines = <$fh>; $files_content{$file}=\@file_lines; close $fh; } foreach $folder (@folders) { foreach $filename (keys %files_content) { push @{ $grep_lines{ $filename } }, grep (/\b$folder\b/i, @{$files_c +ontent{ $filename } }); } } foreach $mk (@{ $grep_lines{ $filename } }) { print "\nIn the loop\n";#Doesnt enter the loop }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to access the hash array values?
by Gulliver (Monk) on Apr 30, 2011 at 20:36 UTC | |
|
Re^3: How to access the hash array values?
by cdarke (Prior) on May 01, 2011 at 06:57 UTC |