Or like this:
use strict; use warnings; my $line="19476 2013-04-05,12:10:51.909293 host:internal.machine44.com +pany.net main INFO Running normally with ACTION=<processing> FAN_A=<O +K> FAN_B=<OK> SEND=<Sent mail (221 2.0.0 Service closing transmission + channel)> FAILURE=<2>"; $line =~ s/\d+ (.*?) /DATE=<$1> /; # to give you the date as well ;) my %info = $line =~ /(\w+)=<(.*?)>/g; print "$_:$info{$_}\n" for keys %info;
UPDATE: Added the date field...
In reply to Re: Some assistance with splitting variables
by hdb
in thread Some assistance with splitting variables
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |