Do you know where your variables are? | |
PerlMonks |
using 'our' on Win32 vs Unixby djbiv (Scribe) |
on Jul 22, 2003 at 15:49 UTC ( [id://276779]=perlquestion: print w/replies, xml ) | Need Help?? |
djbiv has asked for the wisdom of the Perl Monks concerning the following question:
ok.. not sure why this works on one system vs. the other. I have an application that should run on Win32 as well as *NIX systems. I declare several hash's using 'our %some_hash' and the associated values for the hash. here is an example:
this runs fine on Win32 system but when I run this on AIX I get the following error(s): Bareword "our" not allowed while "strict subs" in use at program_name.pl line 139. Bareword "fldFmt" not allowed while "strict subs" in use at program_name.pl line 139. Operator or semicolon missing before %fldFmt at program_name.pl line 139. Ambiguous use of % resolved as operator % at program_name.pl line 139. Global symbol "%fldFmt" requires explicit package name at program_name.pl line 628. Execution of program_name.pl aborted due to compilation errors. perl on win32 is "v5.6.0 built for MSWin32-x86-multi-thread" and the version on AIX is "version 5.005_03 built for aix". Why do I get errors on one system vs. the other? Is this due to perl version / build differences? PS. the program is runs fine using 'my' to declare the hash on both systems (technically the hash should be declared as a global according to programming perl by O'REILLY).
Back to
Seekers of Perl Wisdom
|
|