Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
> I don't have a script named "main"
But you have a package called "main" (unless you declare a package in your main script). If you have no idea what Perl would do, try it. You already know how to create a Perl script and run it. > That just looks tacky and ugly Yes, it looks ugly, because it is ugly. Note that Variable "$x" is not imported is not an error, it's a warning. It's explained in perldiag:
(S misc) With "use strict" in effect, you referred to a global variable that you apparently thought was imported from another module, because something else of the same name (usually a subroutine) is exported by that module. It usually means you put the wrong funny character on the front of your variable. Which doesn't seem helpful, so your confusion is understandable. It seems the explanation needs an addition (volunteers?) Update: The required sub-scripts should have failed to compile under strict. If you're using do instead of require, you should check $@ and $!.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In reply to Re^3: How to import "global" variables into sub-scripts from main script?
by choroba
|
|