Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Inheritting Version

by ioannis (Abbot)
on Oct 27, 2005 at 02:48 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-19 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found