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:[EMAIL PROTECTED] Sent: Monday, February 27, 2006 12:13 AM To: Angus Cc: beginners@perl.org 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; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>