tokuhiromの日記

2009-06-30

今日のキーワード

12:39

utf8フラッグへの対処方針?

2008-04-16

use strict;

{
    package Table;
    use overload '*' => sub { };
}

sub SELECT () { }
sub FROM ($) { $_[0] }
sub foo () { bless {}, 'Table' }

SELECT * FROM foo;

UNIVERSAL の方がいいらし。

use strict;

{
    package Table;
    use overload '*' => sub { };
}

sub SELECT () { }
sub UNIVERSAL::FROM { bless {name => $_[0]}, 'Table' }

SELECT * FROM foo;