import;
}
----
use strict;
use warnings;
----
$^H
${^WARNING_BITS}
----
strict->import
----
affects
compilation
scope
----
use Moose;
----
prototypes
----
sub (&)
----
Try::Tiny
----
try {
...
} catch {
...
};
----
Moose::Util::TypeConstraints
----
type MyType
=> where { $_ =~ /mine/ };
----
sub binding
----
foo()
----
binds at
compile
time
----
... so
you can
delete it
----
namespace::clean
----
use Scalar::Util qw(blessed);
use namespace::clean;
----
delete ${Module::}{blessed};
----
CORE::GLOBAL
----
autodie
----
Fatal
----
open my $fh, '<', $file
or die "Argh: $!";
----
*CORE::GLOBAL::open
----
use autodie;
open my $fh, '<', $file;
----
use feature
----
given ($foo) {
when (/bar/) {
...
}
default {
...
}
}
----
use 5.012; # strict!
----
source
filter
----
Switch.pm
----
ARGH
----
Smart::Comments
----
NOT
ARGH
----
### Debug output here
----
Devel::Declare
----
screw with
the parser
----
method foo ($bar) {
warn $bar;
}
----
TryCatch
----
try {
...
} catch (FileException $e) {
...
}
----
PerlX::MethodCallWithBlock
----
$obj->iterate(3) {
warn "hello! ".$_[0];
};
----
autobox
----
screw with
the semantics
----
[ 1, 2, 3 ]->each(sub {
print "$_\n";
});
----
@stuff->grep(sub {
$_ % 2
});
----
accessor
building
----
*{"${pkg}::${name}"}
= sub { ... };
----
closures
eval
----
Moose
----
metaclass
----
metaclass
metamethod
metaattribute
----
has foo => (
is => 'rw',
trigger => sub { ... }
);
----
compiled
accessors
----
pay only
for what
you use
----
MooseX::Declare
----
class MyClass is MyBaseClass
with MyRole {
method my_method (Str $arg) {
----
pluggable
design
----
CatalystX::Declare
----
sub update :Chained('load_object')
:PathPart('edit') :CaptureArgs(0) {
----
controller MyController {
action update under 'load_object' as 'edit' {
----
----
IPW
----
Web::Simple
----
prototypes
sub binding
CORE::GLOBAL
----
Mike
Whitaker
----
Devel::Declare
----
Dante's
Inferno
----
used to
being
satan
----
----
what if I
don't use
any of them?
----
not
using
code
----
but
first
----
let's shave
a yak
----
foo(..., sub { ... }, ...);
----
how do I
cache that?
----
B::Deparse
----
closures
----
Data::Dump::Streamer
----
closures
----
record
refs
----
local *Data::Dumper::_dump
----
Data::Visitor
----
$save{refaddr($ref)}
= '$input->[1]';
----
dump with
filter
----
if (exists $save{refaddr($ref)}) {
----
{
string => "foo",
code => undef
}
----
$structure->{code}
= $input->[1];
----
my $__captures = {
"\$attr_trigger" => \undef,
"\$attr_name" => \"foo"
};
# fixup code for external references
$__captures->{"\$attr_trigger"} = \((\@_)->[6]);
----
my $orig = MyModule->can('name');
*MyModule::name = sub {