RE: problems parsing a DHCP.leases file.
- From: aglanville@xxxxxxxxxxx (Angus)
- Date: Mon, 27 Feb 2006 00:26:41 -0800
Ryan,
Thanks for the tip however, in this case what I am trying to do (I think) is
find a line that starts with "client-hostname" then match my variable
$hostname to the second thing that the regex matches in that line $1. It
works for the ip address but fails for the hostname. I did try to regex
match but it still returns an undef variable...
-angus
-----Original Message-----
From: The Ghost [mailto:ghost@xxxxxxxxxxxxx]
Sent: Monday, February 27, 2006 12:13 AM
To: Angus
Cc: beginners@xxxxxxxx
Subject: Re: problems parsing a DHCP.leases file.
you need to match something.
You probably meant:
elsif ($line =~ /^client-hostname\s+"([a-z0-9\-\.]+)"/i) {
On the other hand, there is probably a module that already deals with
this and would save you even more coding time.
Ryan
On Feb 27, 2006, at 1:25 AM, Angus wrote:
elsif ($line =~ /^client-hostname/) {
$hostname = $1; }
.
- References:
- Re: problems parsing a DHCP.leases file.
- From: The Ghost
- Re: problems parsing a DHCP.leases file.
- Prev by Date: Re: problems parsing a DHCP.leases file.
- Next by Date: Re: problems parsing a DHCP.leases file.
- Previous by thread: Re: problems parsing a DHCP.leases file.
- Next by thread: Re: problems parsing a DHCP.leases file.
- Index(es):