Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl6
- class foo {
- method bar() {
- return (5,3);
- }
- sub bar() {
- return (5,3);
- }
- method check() {
- my $a = $.bar();
- say 'method result assigned to $: ' ~ $a.perl;
- my @b = $.bar();
- say 'method result assigned to @: ' ~ @b.perl;
- my $c = bar();
- say 'subroutine result assigned to $: ' ~ $c.perl;
- my @d = bar();
- say 'subroutine result assigned to @: ' ~ @d.perl;
- }
- }
- my $obj = foo.new;
- $obj.check();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement