perl-diddler has asked for the wisdom of the Perl Monks concerning the following question:
and am getting the following warnings from this file: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! ;-") );
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).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.
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Values initialized at compile time appear not to be getting initialized..?
by Corion (Patriarch) on Nov 20, 2011 at 10:32 UTC | |
| |
|
Re: Values initialized at compile time appear not to be getting initialized..?
by ikegami (Patriarch) on Nov 20, 2011 at 18:48 UTC |