in reply to Re: Re: virus log parser
in thread virus log parser
Bah, slices are so unattractive ( hi hi hi, he he he he ;D)First of all, the construct foreach(qw(name to file action virus)) { $gCurRec->{$_}=''; } can be expressed very succinctly using so called hash slices, i.e. my @columns = qw(name to file action virus); @{ $gCurRec }{ @columns } = ('') x @columns;
$gCurRec = { map { ( $_ => "" ) } qw{ from to file action virus } };
______crazyinsomniac_____________________________ Of all the things I've lost, I miss my mind the most. perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;" |
In Section
Seekers of Perl Wisdom