- Native MOP
- Autoboxing
- Built-in Try/Catch
- Built-in Fold, Foldr and Unfold list processors
- Lazy lists?
This file contains hidden or 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
| #!/usr/bin/env perl | |
| # Perl 5 needs a does built-in. | |
| # http://perldoc.perl.org/5.14.2/perltodo.html#A-does()-built-in | |
| # | |
| # In an ideal world the syntax would be `$foo does $bar` but Perl doesn't | |
| # seem able to add infix operators via a module, so `$foo ~~does $bar` is | |
| # needed. (Also in an ideal world it would have the same precedence as `eq`. | |
| # |
This file contains hidden or 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
| BEGIN { | |
| package RDF::Trine::Types::X; | |
| $INC{'RDF/Trine/Types/X.pm'} = __FILE__; | |
| use MooseX::Types -declare => ['TrineFormat']; | |
| use MooseX::Types::Moose qw[Str]; | |
| class_type TrineFormat, { class => 'RDF::Trine::Format' }; | |
| coerce TrineFormat, | |
| from Str, | |
| via { 'RDF::Trine::FormatRegistry'->instance->find_format($_) }; | |
| } |
This file contains hidden or 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
| --- orig.pm 2012-09-10 20:46:41.516229122 +0100 | |
| +++ mine.pm 2012-09-10 21:38:36.168228288 +0100 | |
| @@ -1,3 +1,47 @@ | |
| +package RDF::Trine::Parser::TurtleConstants; | |
| + | |
| +no thanks; | |
| +our @EXPORT; | |
| +BEGIN { | |
| + @EXPORT = qw( | |
| + LBRACKET |
This file contains hidden or 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
| use strict; | |
| use warnings; | |
| BEGIN { | |
| package Acme::Constructor::Pythonic; | |
| no thanks; | |
| use Data::OptList qw(mkopt); | |
| use Sub::Install qw(install_sub); | |
| use Module::Runtime qw(use_module); | |
| sub import { |
This file contains hidden or 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
| use v5.14; | |
| use Benchmark ':all'; | |
| use Test::More; | |
| package Base { | |
| no thanks; | |
| sub new { bless \@_, shift } | |
| sub foo { 1 }; | |
| sub bench { | |
| my $class = shift; |
This file contains hidden or 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
| #!/usr/bin/env perl | |
| # This version adds pretty colours, plus command-line option processing | |
| use 5.008; | |
| use strict; | |
| use warnings; | |
| use utf8::all; | |
| use constant { |
This file contains hidden or 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
| { | |
| package Param; | |
| use Moo; | |
| use overload q[""] => q[to_string]; | |
| has [qw/ type name /] => (is => 'ro'); | |
| sub BUILDARGS { | |
| my $class = shift; | |
| if (@_==1 and not ref $_[0] and $_[0] =~ /^([\$\%\@])(.+)$/) { | |
| return +{ type => $1, name => $2 }; | |
| } |
This file contains hidden or 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
| use 5.014; | |
| use Test::More; | |
| package Role { | |
| use Moose::Role; | |
| sub xxx { 'xxx' }; | |
| } | |
| package Handler { | |
| use Moose; |
This file contains hidden or 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
| package Mo::isa; | |
| $MoPKG = "Mo::"; | |
| $VERSION = 0.31; | |
| $Z=CODE; | |
| sub O(_){UNIVERSAL::can(@_,isa)} | |
| sub S(&){pop} | |
| sub Z{1} | |
| sub R(){ref} | |
| sub N(){!defined} |