Results 1 to 3 of 3
I need only sigle vlaue but $val is giving me duplicates. How can I remove duplicates and get the single one.
foreach my $rslt ('ip','host') {
foreach my $val (keys ...
- 02-26-2008 #1Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
Remove duplicate values and then store in array Perl
I need only sigle vlaue but $val is giving me duplicates. How can I remove duplicates and get the single one.
foreach my $rslt ('ip','host') {
foreach my $val (keys %{$ip1->{$rslt}}) {
print "$val\n";
}
}Switched to Scripting
- 02-27-2008 #2Linux User
- Join Date
- Aug 2006
- Posts
- 458
always try the Perl documentation first
Code:perldoc -q duplicate
- 02-27-2008 #3Linux Newbie
- Join Date
- Jan 2008
- Posts
- 114
thanks, I'll take care in future.
Switched to Scripting


Reply With Quote