in reply to Regex how to update
New reply for new question... Just list the important domains in @domainlist:
@domainlist = qw(hostname.foo.com host1-name.foo.com); @DISKD = <inputfile>; foreach $domain (@domainlist) { @value = grep { /\b\Q$domain\E\b/ } @DISKD; for $value (@value) { @data = split /\s+/, $value; $sum += $data[$#data]; } }
|
|---|