Open petdance opened 1 year ago
#!/usr/bin/perl use warnings; use strict; use 5.012; package Itchy 51.50; use Exception::Class ( 'Itchy' => { isa => 'Exception::Class', description => 'blah blah', }, ); package Scratchy 21.12; package Wobbly; use Exception::Class ( 'Wobbly' => { isa => 'Exception::Class', description => 'blah blah', }, ); our $VERSION = 90.125; package main; say 'Itchy is ', $Itchy::VERSION; say 'Scratchy is ', $Scratchy::VERSION; say 'Wobbly is ', $Wobbly::VERSION;
$ perl foo.pl Itchy is 1.1 Scratchy is 21.12 Wobbly is 90.125
Even though the Itchy package has the version number declared as 51.50, the _make_subclass method always sets $VERSION to 1.1.
_make_subclass
$VERSION
So if I want to have a class that is generated by Exception::Class I have to set the VERSION separately.
I think it'd be possible to just use the $VERSION from the package that uses Exception::Class. The issue there might be that the use happens at compile time and it might be before our $VERSION is set.
Exception::Class
use
our $VERSION
Even though the Itchy package has the version number declared as 51.50, the
_make_subclass
method always sets$VERSION
to 1.1.So if I want to have a class that is generated by Exception::Class I have to set the VERSION separately.