#!/use/bin/perl -w use strict; my %ports; $/ = "#-------------------------------------------\n"; while (<DATA>) { chomp; $ports{$1} = $_ if m/^\s+Port (\d+)/; } print $ports{120}; __DATA__ Port 119 NNTP * Microsoft Ports-Microsoft Exchange ... * RFC977 * RFC1036 #------------------------------------------- Port 120 CFDP (UDP) Coherent File Distribution Protocol (CFDP) * RFC1235 #------------------------------------------- Port 123 NTP (UDP) NTP (Network Time Protocol) * RFC2030 * RFC1129
--
John.
In reply to Re: Help Matching Sections of a file
by jmcnamara
in thread Help Matching Sections of a file
by smaida
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |