All i have a hash of hashes as you can see here from data dumper
16-12-2005 14:51: INFO: DATADUMPER: Displaying sent message queue $VAR1 = 'INFO-3-send'; $VAR2 = { '' => '', '32' => '0.0000', '63' => '0', '17' => '491227329', '200' => '200512', '1' => 'A0017C', '44' => '112.52', '55' => 'EUR', '40' => '2', '999' => 'RT', '57' => 'portwaretrader1', '14' => '0.0000', '20' => '0', '59' => '0', '109' => 'DCN32702', '49' => 'RT', '151' => '1.0000', '10' => '248', '31' => '0.00000000', '150' => '5', '35' => '8', '11' => '3104038', '167' => 'FUT', '6' => '0.00000000', '50' => 'RISKGATEWAY', '39' => '5', '41' => '3104032', '52' => '20051118-07:20:30', '38' => '1.0000', '34' => '24', '56' => 'RT', '37' => '365005888', '54' => '1' }; $VAR3 = 'RT-2-send'; $VAR4 = { '' => '', '32' => '0.0000', '63' => '0', '17' => '490522818', '200' => '200512', '1' => 'A0017C', '44' => '112.49', '55' => 'TG', '40' => '2', '999' => 'CAMPBELL', '57' => 'portwaretrader1', '14' => '0.0000', '20' => '0', '59' => '0', '109' => 'DCN32702', '49' => 'TGV', '151' => '1.0000', '10' => '240', '31' => '0.00000000', '150' => '0', '35' => '8', '11' => '3104037', '167' => 'FUT', '6' => '0.00000000', '50' => 'RISKGATEWAY', '39' => '0', '52' => '20051118-07:19:51', '38' => '1.0000', '34' => '23', '56' => 'TGV', '37' => '365006615', '54' => '1' }; $VAR5 = 'FGH-1-send'; $VAR6 = { '' => '', '32' => '0.0000', '63' => '0', '17' => '489687730', '200' => '200512', '1' => 'A0017C', '44' => '112.49', '55' => 'QWE', '40' => '2', '999' => 'DSF', '57' => 'portwaretrader1', '14' => '0.0000', '20' => '0', '59' => '0', '109' => 'DCN32702', '49' => 'sdfsdf', '151' => '1.0000', '10' => '252', '31' => '0.00000000', '150' => '0', '35' => '8', '11' => '3104032', '167' => 'FUT', '6' => '0.00000000', '50' => 'RISKGATEWAY', '39' => '0', '52' => '20051118-07:19:00', '38' => '1.0000', '34' => '22', '56' => 'DSFSDF', '37' => '365005888', '54' => '1' };
The problem i have is when i try and loop over it with for i get the following.
my $sc = scalar(%messagerecbin); &writelog(1,"Message rec bin = $sc "); foreach my $file (keys %messagerecbin) { if($debug){&writelog(1,"DEBUG: sqlloader_rt: receive Messag +ebin{$file} message: Loading sql below.");} }

Message log below.
16-12-2005 14:51: Message rec bin = 2/8 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{INFO-3-send} + message: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{RT-2-send} m +essage: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{FGH-1-send} +message: Loading sql below. 16-12-2005 14:51: Message rec bin = 2/8 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{INFO-3-send} + message: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{RT-2-send} m +essage: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{FGH-1-send} +message: Loading sql below. 16-12-2005 14:51: Message rec bin = 2/8 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{INFO-3-send} + message: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{RT-2-send} m +essage: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{FGH-1-send} +message: Loading sql below. 16-12-2005 14:51: Message rec bin = 2/8 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{INFO-3-send} + message: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{RT-2-send} m +essage: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{FGH-1-send} +message: Loading sql below. 16-12-2005 14:51: Message rec bin = 2/8 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{INFO-3-send} + message: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{RT-2-send} m +essage: Loading sql below. 16-12-2005 14:51: DEBUG: sqlloader_rt: receive Messagebin{FGH-1-send} +message: Loading sql below.
So it seems to get printed out to many times

jdporter added code tags


In reply to Hash of hashes returning to many values by minixman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.