Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Inheritting Version

by ioannis (Abbot)
on Oct 27, 2005 at 02:48 UTC ( #503218=note: print w/replies, xml ) Need Help??


in reply to Inheritting Version

In the following code, it is the version number is defined by the constant pragma, and all package variables of the form our $package::VERSION refer to the constant function which is inherited by default. In this way, all normal queries for version information get the same number from the same source. Is this what you wanted?
package Person; use constant VERSION => '5.0'; our $VERSION=VERSION; package American; use base 'Person'; our $VERSION=__PACKAGE__->VERSION; package main; use American; print 'version=', $Person::VERSION; print 'version=', $American::VERSION;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://503218]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2022-11-30 21:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?