What does it not do...what did it used to do...are there any error messages
or warnings now?
-----Original Message-----
From: Ron Rohrssen
To: Perl Beginners
Sent: 8/21/2001 3:49 PM
Subject: Hash of structures not working in latest Perl build on Windows?
I have a section of code the works on Win 98 and NT using Perl version
5.005_03.
However, the same code does not work under Win NT using Perl version
5.6.1.
Can someone help me identify why this does not work in the latest Perl
version?
Here is a code snippet.
-----------
#Create the hash with code like this
struct ReportStruct => { # The data to store for accumulated data
CallsTDD => '$', #A count of the number of calls meeting the TDD
criteria
CallsVoice => '$', #A count of the number of calls meeting the
voice
criteria
DataDate => '$', #The actual date when the BDR was cut, does not
include time
};
if (exists($AccumHash{$lclKey}) == 1)
{
$AccumHash{$lclKey}{CallsVoice} = $AccumHash{$lclKey}{CallsVoice} +
int($CallsVoice);
$AccumHash{$lclKey}{CallsTDD} = $AccumHash{$lclKey}{CallsTDD} +
int($CallsTDD);
}
else #Creating a new hash element and add this to the list
{
$p = ReportStruct->new(); #allocate a new structure to hold the
information
$p->CallsVoice(int($CallsVoice));
$p->CallsTDD(int($CallsTDD));
$p->DataDate($DataDate);
$AccumHash{$lclKey} = $p;
}
----------------
#Loop through the hash and work on the data in the hash
@index = sort (keys (%AccumHash));
foreach $curr_key (@index)
{
print "The data date stored in the hash is
".$AccumHash{$curr_key}{DataDate}." for BDR File ".$BDR_FileName."\n";
}
Thanks
Ron Rohrssen MCI
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]