Hello all.
I am in the process of migrating a very messy code, partially working. In my work (I have done virtually no threaded work before) I came across a code that assigns a reference to a shared hash to a value in another shared hash. I added cluck to get the address info, and The value assigned is different than the value stored, if I read the output correctly Code is:
my %all_shary_for_subs :shared;
my %sim_info :shared; $all_shary_for_subs{'%si
+m_info'}=\%sim_info;
cluck("the sim_info glob ref is:" . \%sim_info . "\n" );
cluck("And in the hash it is:" . $all_shary_for_subs{'%sim_info'} . "\
+n" ) ;
The output of the code is the following (everything else is just use Carp, threads, threads::shared and comments)
the sim_info glob ref is:HASH(0x241bea8)
at /edata/eng/ldagan/voodoo_from_1.1.7.b4/DesignLibs/ScriptLib/Generic/WMPerl/voodoo/voodoo_beta.pl line 81
And in the hash it is:HASH(0x2e42990)
at /edata/eng/ldagan/voodoo_from_1.1.7.b4/DesignLibs/ScriptLib/Generic/WMPerl/voodoo/voodoo_beta.pl line 82
Why are the two addresses different?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.