in reply to Re: using an object as a variable type
in thread using an object as a variable type
Not sure how the title is nonsense, I wish to constrain the behaviour of the variable to that defined in the 'Me' object so is the package not providing the type of the variable ? I am trying to do this using the syntax of threads::shared which I guess is instantiating a threads::shared object and assigning it to the given variable name. I can live with what I have now my $m = new Me (Random); but out of curiosity and to improve my Perl foo I want to discover and emulate how my $val : shared works.
Not sure how eval can help me here, I don't want to trap the errors, I am intending to enforce limits on the varaiable and croak if an attempt is made to assign an illegal value to it.
Pereant, qui ante nos nostra dixerunt!