I have the following:
package Cmds; #{{{ use Readonly; sub RO(\[$@%]@){goto &Readonly}; use File::SearchPath qw /searchpath/; RO our $sig => "%%"; #improbable filename prefix RO our $Dflt_Path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin +"; sub skey($) {$sig.$_[0]} our %Global_Cache = ( # Global cache fo +r non-OO use skey("asis") => 0, skey("Firstcap") => 1, skey("prefix_ln") => 0, skey("post_ln") => 0, skey("SAFE_PATH") => $Dflt_Path, skey("PATH") => $Dflt_Path, skey("path_safe") => 1, skey("imp_init") => 1, #global alread +y is initialized! ;-") );
and am getting the following warnings from this file:
Use of uninitialized value $Cmds::sig in concatenation (.) or string a +t ./shaper.pl line 58. Use of uninitialized value $Cmds::sig in concatenation (.) or string a +t ./shaper.pl line 58. Use of uninitialized value $Cmds::sig in concatenation (.) or string a +t ./shaper.pl line 58. Use of uninitialized value $Cmds::sig in concatenation (.) or string a +t ./shaper.pl line 58. Error extracting directories from environment. No defined values suppl +ied. Internal programming error at ./shaper.pl line 76 Compilation failed in require at /home/law/bin/lib/Network/Interface.p +m line 6. BEGIN failed--compilation aborted at /home/law/bin/lib/Network/Interfa +ce.pm line 6. Compilation failed in require at ./shaper.pl line 226. BEGIN failed--compilation aborted at ./shaper.pl line 226.
line 58 is the 1 line routine in the listing that defines sub skey (concatenating a constant with any param to form a keyname that I thought I would be likely to use as part of a filename...;-))... I had "\0x00" in the beginning of the key, figuring that'd be impossible for use in a Unix file name (and didn't think it should be a problem as a hash key), but thought that might be causing this issue. so replaced it with a dup of the 2nd char).

So why is it ignoring the define of '$sig' immediately above it? and claiming it is "undefined"

I also tried"$sig" as a package as 'my'...nada...(same error)

So...doesn't like my/our, ?... um?...

What am I missing?


In reply to Values initialized at compile time appear not to be getting initialized..? by perl-diddler

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.