in reply to Re: Help Matching Sections of a file
in thread Help Matching Sections of a file
Is there a way to do this with the '..' or '...' operator without having to do the extra match (the and !/^#---/ part)?#!/usr/bin/perl my $port = $ARGV[0] or die "usage: $0 <portnumber>\n"; while (<DATA>) { print if /Port\s+$port/ .. /^#---/ and !/^#---/; } __DATA__ Port 119 NNTP * Microsoft Ports-Microsoft Exchange supports a News server running at + this port. * RFC977 * RFC1036 #------------------------------------------- Port 120 CFDP (UDP) Coherent File Distribution Protocol (CFDP) * RFC1235 #------------------------------------------- Port 123 NTP (UDP) NTP (Network Time Protocol) * RFC2030 * RFC1129 #--------------------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Help Matching Sections of a file
by TilRMan (Friar) on Apr 05, 2004 at 09:57 UTC | |
by Elijah (Hermit) on Apr 05, 2004 at 15:17 UTC | |
by TilRMan (Friar) on Apr 05, 2004 at 16:26 UTC |