Tom Christiansen wrote:
>
> Perl should fly far and fast from starting down the bumpy road where
> that data is strongly typed in the mythical and deceptive text-vs-binary
> sense ... Heed the wisdom of the Unix ...
Tom's exactly right. Data should be data, at least by default.
One of the beauties of UNIX, and one of the reasons it doesn't suck
(unlike some other "operating systems") is that it's guided by
simplicity: everthing's a file, and a file contains data. No drive
letters or .txt vs .exe files to ruin your day.
If you need the facility to do this type of checking, tie, operator
overloading, and more is there for you. As the examples show, this is an
infinitely complicated issue.
One thing that Nat will soon be releasing is an RFC on strict typing.
I'll also have one (hopefully) on an embedded tie-like solution that
will allow you to create your own variable types. With these you would
conceivably be able to say:
use strict 'types';
my packed $b = 5; # oops!
Basically, I think the type of stuff you suggest is best viewed as
*extensions* to Perl, and not default behavior that could potentially
cause many more problems than it solves.
-Nate