Gregory S Hayes wrote:
> Types just seem so very un-perl. There is much to be said for the
> universal scalar vairable. I'm not sure I fully understand just why we
> NEED types in the language. We have functions such as:
>
> my $integervalue = int($value);
>
> and...
>
> my $float = sprintf("%2.2f", $integervalue);
>
> So what are the benifits of types?
>
Efficiency: For instance, an array of identical simple types can be stored
contiguously and accessed directly.

Robustness: Operations which do not make sense for a particular type can be
caught at compile time or at run time. This can make it easier to create
robust programs.

*Allowing* typing is not the same as *demanding* typing. Adding types will
not make the 'universal scalar variable' any less accessible or convenient.


Reply via email to