use warnings; use strict; my $host = ""; my $interface = ""; my $PRIList = ""; my $T1List = ""; my $T1Count = 0; my $PRICount = 0; my @check = grep { chomp $_; $_ } ; for (@check) { if (m{([0-9]/[0-9]/[0-9])$}) { $T1Count++; $interface = $1; $T1List .= $interface . "\n"; } elsif (m{pri-group}) { $PRICount++; $PRIList .= $interface . "\n"; } } if ( $T1Count > 0 ) { print "T1 Controller Summary:\n\n"; print "$T1Count total T1 interfaces\n"; print $T1List; print "$PRICount total voice PRI(s)\n"; print $PRIList; } else { print "No T1 interfaces found"; } __DATA__ controller T1 0/0/0 framing esf linecode b8zs cablelength long 0db pri-group timeslots 1-24 controller T1 0/0/1 framing esf linecode b8zs cablelength long 0db controller T1 0/1/0 framing esf linecode b8zs cablelength long 0db controller T1 0/1/1 framing esf linecode b8zs cablelength long 0db