Perhaps this could be a job for
use overload.
Use byVersion as the comparison operator,
and create a simple function for the stringification operator.
If your constructor simply blesses a reference to the string, the stringification would be something as simple as:
my to_string{
my $s=shift;
return $$s;
}
I've just done something similiar with the versions names we use for
our software releases. They are a bit weirder, but it works great...
GoldClaw