in reply to A Not so Simple Append
Secondly what you need to do is walk through the file building up a data structure with your info, then walk through that and print. Something like this (untested) code:
open (PRV, "<$private") or die "Cannot read $private: $!"; my %connected; while (<PRV>) { chomp; my ($far, $dev) = (split(' ', lc($_)))[0,3]; push @{$connected{$far}}, $dev; } foreach my $dev (sort keys %connected) { my $fars = join ", ", @{$connected{$dev}}; print "$dev is connected to: $fars\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re (tilly) 1: A Not so Simple Append
by Limo (Scribe) on Oct 03, 2000 at 01:32 UTC |