# New Ticket Created by   
# Please include the string:  [perl #130378]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=130378 >


Vis-a-vis the following: http://dabe.com/misc/perl6-class_method.html

## Foo.pm

       class Foo::Bar { has $.var }
            $Foo::var  = 42;

    package Foo { our sub x { say "X" } }
            &Foo::y =  sub   { say "Y" };
    our sub Foo::z          { say "Z" }

## foo.p6

    #!/usr/bin/env perl6

    use lib $*PROGRAM.resolve.dirname;
    use Foo;

    Foo::Bar.new;     # OK
    say $Foo::var;    # OK: 42

    Foo::x;           # OK: X
    Foo::y;           # OK: Y
    Foo::z;           ## X::AdHoc.new(payload =>  "Could not find symbol '\&z'")


There was some discussion on #perl6 
<https://irclog.perlgeek.de/perl6/2016-12-09> about whether the compiler 
should disallow such long names [psch++], or whether it should stuff it 
in a package and vivify it for you [jnthn++].

IMHO, as a typical perl5 switcher, jnthn's solution seems the most 
DWIM-ish --- and since the other alternatives offer just as much "spooky 
action at a distance", it seems surprising that "our sub 
Long::Package::name" wouldn't have the same effect.

Just my 2ยข...  :-D

Reply via email to