in reply to Declaring a variable's type

This depends largely on what you are actually trying to accomplish. You could use Attribute::Types to simulate type-checking, but there's a good chance you don't actually need strong typing.

You could also create the behavior you want using overload and creating appropriate modules from which you can instantiate objects. You might also be looking for integer math. Or, if you're doing input validation, type casting, or something similar, you could use Data::Types.

So, what specifically are you aiming to accomplish?

<-radiant.matrix->
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
I haven't found a problem yet that can't be solved by a well-placed trebuchet

Replies are listed 'Best First'.
Re^2: Declaring a variable's type
by sanPerl (Friar) on Mar 04, 2006 at 02:44 UTC
    I needed this feature for input validation, which my tool would take from commandline arguments. I had plans to parse arguments through regex, but it seems I can use Attribute::Types and Data::Types for it
    Thanks to everyone for the help.