While the implicit change works on most (if not all) situations it would be
nice to have a way to control the conversion. Maybe a more practical example
would be:
open(F,"data.txt");
while($line = <F>)
{
$line.chomp;
}
-----Original Message-----
From: Jonathan Scott Duff [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 14, 2000 1:40 PM
To: Lipscomb, Al
Cc: '[EMAIL PROTECTED]'
Subject: Re: RFC 89 (v2) Controllable Data Typing
On Mon, Aug 14, 2000 at 01:27:11PM -0400, Lipscomb, Al wrote:
> With some of the other suggestions to improve the "object" model in Perl I
> was wondering if this would not be the time to ask about object-like
> behavior around the simple scalar things.
>
> For example if we had something like this:
>
> my $id;
> $id = "007";
> print "My ID is $id->string\n";
>
> Having methods and properties on the basic data types seems like a nice
> thing.
We sorta do already. You can think of
print "my ID is $id\n";
as calling the "toString" method for $id. We currently just don't
have a way to explicitly get at that method except by supplying the
proper context.
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]