Jorge Goncalvez wrote: > Hi, i have this: > open INFILE, "< $_Globals{SYSLOG}" or die $!; > #ModifiedFile(); > while (<INFILE>) { > if (/([0-9a-z:]+)\s*via eth0)/) { > $_Globals{MAC_ADDR} = $1; > } > } > And my file is like this: > ..... > LOG_INFO : BOOTREQUEST from 00:80:9f:2e:0f:9c via eth0 > ...... > it worked but i wanted also to match the mac eddress if i have this > LOG_INFO : BOOTREQUEST from 00:80:9f:2e:0f:9c via eth1 > > I tried this but it didn't work: > if (/([0-9a-z:]+)\s*via ([eth])/) {
Are you sure this did not match. Worked for me $1 contains the mac address. If you are also trying to capture eth0 or eth1 this will not give you that. [eth] is a character class that matches either e or t or h. Maybe you want this /([0-9a-z:]+)\s*via (eth\d) > > ...... > > Thanks. > > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]