develooper Front page | perl.perl6.language | Postings from March 2005

sub and method name overlap.

Thread Next
From:
Rod Adams
Date:
March 10, 2005 13:27
Subject:
sub and method name overlap.
Message ID:
4230BBBB.2000209@rodadams.net
Given:

    class Foo {
       method Bar () {...};
    }

    sub Bar (Any $x) {...};
    my Foo $f;

    Bar $f;


Is that last line the same as:
    &Bar.($f);
or
    $f.Bar;

Does it matter if we change C< sub Bar > to C< multi sub Bar >?

Is there some form of implicit multi sub that gets created to make C< 
Bar $f; > C< $f.Bar >? Or does it only work if there is no C< multi? sub 
bar > in sight?

-- Rod Adams


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About