in reply to Yet another question about reading in data from a file for use in another file

I'm sure there are better ways of doing the 'split', but the following works for me:
use strict; use warnings; use diagnostics; my %forchecking; while (<DATA>) { chomp; my @sFields = split /\s+/; $forchecking{substr($sFields[3],0,5)} = $sFields[8]; } __DATA__ Data Collected for SA120:Prct Dirty Cache Pages = 0 Data Collected for SA121:Prct Dirty Cache Pages = 1 Data Collected for SA122:Prct Dirty Cache Pages = 0 Data Collected for SA220:Prct Dirty Cache Pages = 0 Data Collected for SA221:Prct Dirty Cache Pages = 0 Data Collected for SA222:Prct Dirty Cache Pages = 17
Regards,

John Davies
  • Comment on Re: Yet another question about reading in data from a file for use in another file
  • Download Code