$|++; AUTOLOAD; use strict; use warnings 'all'; if (open(FILE,"c:\\logfile.txt")) { print "\nExtracting Data from c:\\logfile.txt.......Please Wait: "; $/='*' x 66; my @ShowtechLog =; close FILE; print "Done\n\n"; my ( $Interface, $InterfaceInfo, $SwitchPort, $SwitchDesc ); for my $data (@ShowtechLog) { if ($data =~ /show running-config/) { for (split (/\n+/,$data)) { $Interface = $1, next if (/interface port-channel (\d+)$/); $InterfaceInfo->{$Interface}->{$1} = $2 if (/switchport description To (\w+) ([\d\.]+)/); $SwitchPort = $1, next if (/^interface (fc\d+\/\d+)$/); $SwitchDesc->{$SwitchPort} ={$1} if (/switchport description (.+)/); } } } print "\nPort Descriptions\n"; for my $Port (keys %{$SwitchDesc}) { print "$Port : "; for my $Desc (keys %{$SwitchDesc->{$Port }}) { print "$Desc\n"; } } } else { warn "\n$!\tc:\\logfile.txt\n"; }