#!/usr/local/stow/perl-5.6.1/bin/perl -w use GDBM_File; my $portlist = "/dfs/umaint/stow/UMno/libdata/portlist"; my %ports; tie(%ports,'GDBM_File','gdbmtest',&GDBM_NEWDB,0644) or die "$!\n"; open(PL, $portlist) or die "$!\n"; while() { chomp; next if(/^\#/ || $_ eq ""); my ($switch,$ifnum,$trunk,$desc) = split(/:/); my ($generated,$conn,$notes) = split(/\s(\+|-|!)\s*/,$desc); my ($ifname,$vlan,$host) = split(/\s/,$generated); $ports{"$switch:$ifnum"} = "$trunk:$ifname:$vlan:$host:$conn:$notes"; } untie(%ports) or warn "$!\n";