in reply to (jeffa) Re: Apache IP-Autoupdater
in thread Apache IP-Autoupdater
This could be reduced to a one-liner:@ARGV = ('httpd.conf'); while (<>) { print("Line = $.\nName = $1\n"), last if /^ServerName\s+(\S+)\s*$/; }
Bit long though.% perl -ne 'print("Line=$.\nName=$1\n"), last if /^ServerName\s+(\ +S+)\s*$/;' httpd.conf
|
|---|