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
In reply to Re: Re: Apache IP-Autoupdater
by btrott
in thread Apache IP-Autoupdater
by Nimster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |