How can I set a Java-like "static variable" in Perl that can be accessed by other classes ? -


A and B, I need to set a static variable (such as a variable variable in Java) in class A. I "post-text" itemprop = "text">

, and access to variable from class B (Java Using the classname. Variable name). Can I do something like this in Perl?

Thank you in advance

I do not know if I do not really know Java What I mean by "static variable" is what is to do with scoping? In Perl 'my' and 'our' you can control the scope, but I believe that I am right that the cap package / module creates the variable "personal" which is .pm The file is declared << Strong> How to "access" my copy of the programming Pearl (second edition) to include them in the chapter? 2 Scoded Declaration But before page 117 there is a small (slightly edited) portion of the footnote:

Use the packages to store personal data in libraries , Modules, and classes, so it does not conflict with it if you see data in your main program that someone writes $ Some :: stuff then that package some < $ / Value> using the $ $ scalar variable May include.

Documentation and this can help you to be clear in your thinking about variables and scope in Perl. The classic perlmax node - - often referred context is: -)

If you already know how to program (i.e. in Java) sometimes a better reference (only

Cheers, for working in Pearl "How To" Pearl cookbook .

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -