One problem is that your code doesn't compile. If you add
use strict; use warnings;

you'll get

Global symbol "$modulename" requires explicit package name at /apps/ot +ctest/bin/report/Test0.perl line 10. Global symbol "$usermodule" requires explicit package name at /apps/ot +ctest/bin/report/Test0.perl line 11. Global symbol "$param1" requires explicit package name at /apps/otctes +t/bin/report/Test0.perl line 14. Global symbol "%hash2" requires explicit package name at /apps/otctest +/bin/report/Test0.perl line 14. Global symbol "$array" requires explicit package name at /apps/otctest +/bin/report/Test0.perl line 17. Global symbol "@mykeys" requires explicit package name at /apps/otctes +t/bin/report/Test0.perl line 20. Global symbol "$hashref" requires explicit package name at /apps/otcte +st/bin/report/Test0.perl line 20. Execution of /apps/otctest/bin/report/Test0.perl aborted due to compil +ation errors.

If you define all that, then you'll finally see: When I run your sample code, I get the error:

Null filename used at /apps/otctest/bin/report/Test0.perl line 19.

(That's your require ${modulename}; statement.)

Can you post the minimal runnable code that produces the problem you wish us to research?

How do you define $modulename?

Revised after I was chastened by chromatic for unintended rudeness.


In reply to Re: hash values missing by apl
in thread hash values missing by rbm1213

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.