Tuna has asked for the wisdom of the Perl Monks concerning the following question:
I need to compare both hashes, and if:open (BEG_PUB_FILE, "$as_dir/$beg_pub_file") || die "Cannot open: $!\n"; while ($pub_line = <BEG_PUB_FILE>) { chomp $pub_line; next if ($pub_line =~ /unknown|shutdown/); ($as,$as_name,$neighbor,$router,$interface,$address, $interface_name,$ifindex,$vpi,$vci) = split(' ',$pub_line); push @{$HoL_pub{$router}}, $interface_name; } foreach $pub_element(@pub) { open FILE, "$as_dir/$element" || die "Can't open $as_dir/$element: $!\n"; while ($compare_pub = <FILE>) { chomp $compare_pub; next if ($compare_pub =~ /unknown|shutdown/); ($as,$as_name,$neighbor,$router,$interface,$address, $interface_name,$ifindex,$vpi,$vci) = split(' ',$compare_lines); push @{$HoL_compare_pub{$router}}, $interface_name; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comaring contents of 2 Hash of Arrays
by dfog (Scribe) on Feb 20, 2001 at 05:59 UTC | |
by bbfu (Curate) on Feb 20, 2001 at 09:37 UTC | |
|
(dkubb) Re: (2) Comparing contents of 2 Hash of Arrays
by dkubb (Deacon) on Feb 20, 2001 at 09:33 UTC | |
by sierrathedog04 (Hermit) on Feb 20, 2001 at 17:56 UTC |