1. You shouldn't use Switch.pm, it has subtle bugs.
  2. What's the switch for here anway, all you're doing is execute one "case" after the other, there's no fall-through or anything that requires this execution out of a standard for-loop.
  3. Running this codes gives the following output:
0 --HASH(0x82bfd04) Data_Directories_fetch 1 --HASH(0x828b9a8) Data_Directories_erase 2 --HASH(0x82bbf40) Program_fetch 3 --HASH(0x82bfcbc) Program_erase 4 --HASH(0x82bbec8) Configuration_and_Table_Files_erase 5 --HASH(0x815b734) Configuration_and_Table_Files_fetch 6 --HASH(0x82bbee0) Create_Database 7 --HASH(0x82bbe38) Load_Database HASH(0x82bbf40) Result: HASH(0x82bbf40)

Loading some values into the Program_fetch hash first gives:

0 --HASH(0x82bc21c) Data_Directories_fetch 1 --HASH(0x82bfd00) Data_Directories_erase 2 --HASH(0x8160c8c) Program_fetch 3 --HASH(0x82bc0f0) Program_erase 4 --HASH(0x82bfce8) Configuration_and_Table_Files_erase 5 --HASH(0x815b728) Configuration_and_Table_Files_fetch 6 --HASH(0x82bc12c) Create_Database 7 --HASH(0x82bfd84) Load_Database HASH(0x8160c8c) 1 => 2 3 => 4 Result: HASH(0x8160c8c) 1 => 2 3 => 4

Which is exactly what I'd expect. What are you expecting to see?


There are ten types of people: those that understand binary and those that don't.

In reply to Re: Dereferencing Mystery by tirwhan
in thread Dereferencing Mystery by Anonymous Monk

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.