Created
July 29, 2023 18:10
-
-
Save stevan/e120a5100914946df99662ecfe508895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use v5.38; | |
package Test::Foo; | |
use v5.38; | |
use experimental 'class'; | |
sub get_bar (@args) { | |
Test::Foo::Bar->new( @args ) | |
} | |
class Test::Foo::Bar { | |
field $bar :param = "BAR"; | |
method bar { $bar } | |
} | |
package main; | |
my $foo = Test::Foo::Bar->new; | |
warn $foo->bar; | |
__END__ | |
Subroutine attributes must come before the signature at t/test.pl line 14. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment