Re: Record separator and regex switch

2007-02-26 Thread Beginner
On 26 Feb 2007 at 18:13, D. Bolliger wrote: > Beginner am Montag, 26. Februar 2007 17:02: > > On 26 Feb 2007 at 15:58, D. Bolliger wrote: > > > Beginner am Montag, 26. Februar 2007 14:50: > > Hi > > > > > I am trying to parse some dhcp-lease files to extract the ip, mac and > > > > hostname. ..s

Re: Record separator and regex switch

2007-02-26 Thread D. Bolliger
Beginner am Montag, 26. Februar 2007 17:02: > On 26 Feb 2007 at 15:58, D. Bolliger wrote: > > Beginner am Montag, 26. Februar 2007 14:50: Hi > > > I am trying to parse some dhcp-lease files to extract the ip, mac and > > > hostname. > > > > > > I am struggling to get either, the regex of the $/,

Re: Record separator and regex switch

2007-02-26 Thread John W. Krahn
Beginner wrote: > On 26 Feb 2007 at 15:58, D. Bolliger wrote: >> >>#!/usr/bin/perl >> >>use strict; >>use warnings; >> >>{ >> local $/="}\n"; >> for () { >>my ($ip,$mac,$host)= >> /lease\s+(\S+).* >>ethernet\s+(\S+);.* >>hostname\s+(\S+); >> /sx; >>print "I

Re: Record separator and regex switch

2007-02-26 Thread Beginner
On 26 Feb 2007 at 15:58, D. Bolliger wrote: > Beginner am Montag, 26. Februar 2007 14:50: > > Hi, > > Hi > > > I am trying to parse some dhcp-lease files to extract the ip, mac and > > hostname. > > > > I am struggling to get either, the regex of the $/, correct. I am not > > sure which combinat

Re: Record separator and regex switch

2007-02-26 Thread D. Bolliger
Beginner am Montag, 26. Februar 2007 14:50: > Hi, Hi > I am trying to parse some dhcp-lease files to extract the ip, mac and > hostname. > > I am struggling to get either, the regex of the $/, correct. I am not > sure which combination of these I should use. > > There is some sample data and my b

Record separator and regex switch

2007-02-26 Thread Beginner
Hi, I am trying to parse some dhcp-lease files to extract the ip, mac and hostname. I am struggling to get either, the regex of the $/, correct. I am not sure which combination of these I should use. There is some sample data and my best effort below. Can anyone offer any pointers? TIA, Dp.