When I dump the hash that this script creates, the inner hash, "tapes" can have duplicate values. I'll post some output to illustrate. I want only unique (in this case) tape id's to be included.
Here's some example output that I'm trying to avoid:#!/opt/openv/perl/bin/perl -w use strict; use Data::Dumper; use NBUX; my %images = bpimagelist(); #print Dumper(\%images); #exit; my (%status); foreach my $key (sort keys %images) { my ($tapes, $img); my $client = $images{$key}->{'client'}; my $sched_type = $images{$key}->{'schedule_type'}; my $sched_name = $images{$key}->{'sched_label'}; my $policy = $images{$key}->{'policy'}; my $kb = $images{$key}->{'kbytes'}; foreach my $key2 (sort keys %{$images{$key}}) { if ($key2 =~ /copy_\d_frag_\d_id/) { $img = $images{$key}{$key2}; $tapes = (join (' ', $img, $tapes)); $status{$client}{$policy}{'tapes'} = $tapes; } } } #print Dumper(\%status); #exit;
$VAR1 = { 'bondsrv1' => { 'acis_misc_os' => { 'tapes' => 'OK0238 OK0238 ' + } }, }
In reply to Join unless $var has already been joined? by blink
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |