I'm extremely new to Perl and, surprise, have a problem. I've read the
Camel Ch. 9 (Generation of a hash of complex records) many times but I
just don't seem to get the hash loaded correctly when I try it myself.
Any guidance - examples - are appreciated!
Here's the problem:
I am trying to produce a report that reads 1-3 input files (backup
reports) and parses them for information that will later be printed out
in a 1-3 column report (depending on the number of input files). I
have no problem reading, parsing the files and finding the information I
need but loading (and then printing) the hash is proving more difficult.
I suppose I could load a separate array for each input file but I was
thinking it'd be better to have one hash that held all the information.
I'm confused on how to load a hash correctly given the input data below.
########################
Input files would look something like this: ( the number of job
operations will vary with each input file)
INPUT FILE 1
job operation: backup note: (the # of job ops will vary with
each input file)
cartridge: M70001
backup start: 08/01/01
backup end: 08/01/01
bytes: 50433
job operation: verify
backup start: 08/01/01
backup end: 08/01/01
bytes: 50433
Job completion: Successful
########################
The output data structure might look something like this:
%HASH = (
filename => {$filename => $inputfile,
@joboparray => [ {jobop=>$jobop, cart =>
$cart, startdate=>$sdate, enddate=>$edate, bytes
=>$bytes} ],
$jobstatus => $jobstatus
},
);
########################
Output Report Format (example)
Input File 1 Input File 2
InputFile 3
M7001 M7001
M7001
JobOp backup backup backup
Start 08/01/01 08/02/01
08/03/01
End 08/01/01 08/02/01
08/03/01
Bytes 50433 51532
59002
JobOp backup
backup
Start
08/01/01 08/03/01
End 08/01/01
08/03/01
Bytes
50433 59002
JobOp verify verify
verify
Start 08/01/01 08/02/01
08/03/01
End 08/01/01 08/02/01
08/03/01
Bytes 50433 51532
59002
JobOp
verify verify
Start
08/01/01 08/03/01
End 08/01/01
08/03/01
Bytes 50433
59002
Status Successful Unsuccessful
Successful
Thanks and sorry for the long post, but there's no simple way to explain
it all.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]