theroninwins has asked for the wisdom of the Perl Monks concerning the following question:
The prob:if ($line[0]=~ /^c/) { $line =~/(0x[A-Fa-f0-9]+).*(0x[A-Fa-f0-9]+).*((unit=([ +0-9]+)))/i; my @error = ($1, $2); my $value1= hex $error[0]; my $value2= hex $error[1]; my $unit= $5; $line =~/(port=([0-9]+))/i; my $port= $2; print "Value1: $value1,Value2: $value2, Unit: $unit,P +ort1: $port,Stat: $line[6]\n"; } ----data------ Ctl Date Severity Alarm Message ---------------------------------------------------------------------- +-------- c0 [Mon Apr 10 15:12:42 2006] INFO (0x04:0x000B): Rebuild star +ted: unit=0 c0 [Mon Apr 10 15:12:09 2006] INFO (0x04:0x003B): Rebuild paus +ed: unit=0 c0 [Mon Apr 10 15:08:28 2006] INFO (0x04:0x000B): Rebuild star +ted: unit=0 c0 [Mon Apr 10 15:06:31 2006] ERROR (0x04:0x0002): Degraded uni +t: unit=0, port=1 c0 [Mon Apr 10 15:06:31 2006] WARNING (0x04:0x0019): Drive was re +moved from a bay: port=1
2006-04-11 Retitled by g0n, as per Monastery guidelines
Original title: 'matching pattens'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching patterns
by Corion (Patriarch) on Apr 11, 2006 at 07:02 UTC | |
by theroninwins (Friar) on Apr 11, 2006 at 07:07 UTC | |
|
Re: matching patterns
by Zaxo (Archbishop) on Apr 11, 2006 at 07:18 UTC | |
by theroninwins (Friar) on Apr 11, 2006 at 07:45 UTC | |
by SamCG (Hermit) on Apr 11, 2006 at 22:51 UTC |