package Foo;
use Moose;
# mark overloads as methods and wipe other non-methods
use MooseX::MarkAsMethods autoclean => 1;
# define overloads, etc as normal
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
#!/usr/bin/env perl | |
# | |
# Chris Weyl <[email protected]> | |
use strict; | |
use warnings; | |
use lib '/usr/share/bugzilla'; | |
use Plack::App::CGIBin; |
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 tests subpackage macros... | |
%perl_version %(eval "`%{__perl} -V:version`"; echo $version) | |
%perl_testdir %{_libexecdir}/perl5-tests | |
%cpan_dist_name %(eval echo %{name} | %{__sed} -e 's/^perl-//') | |
# easily mark something as required by -tests and BR to the main package | |
%tests_req() %{expand:\ |
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
package MooseX::AutoDestruct; | |
# ABSTRACT: Clear your attributes after a certain time | |
use warnings; | |
use strict; | |
use namespace::autoclean; | |
# debugging |
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
package MooseX::MarkAsMethods; | |
# ABSTRACT: Mark overload code symbols as methods | |
use warnings; | |
use strict; | |
use namespace::autoclean; | |
use B::Hooks::EndOfScope; |
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
package MooseX::AttributeShortcuts; | |
# ABSTRACT: Shorthand for common attribute options | |
use strict; | |
use warnings; | |
use namespace::autoclean; | |
use Moose (); |
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
#!/usr/bin/env perl | |
# A small scriptie to clean up all those branches that get carried over | |
# after a github fork that (99% of the time) end up cluttering everything up | |
# and obscuring your own branches :) | |
# | |
# This script is under the GNU GPL, either version 2 or (at your option) any | |
# later version. | |
# | |
# Chris Weyl <[email protected]> 2010. |
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
#!/usr/bin/env perl | |
# This script is under the GNU GPL, either version 2 or (at your option) any | |
# later version. | |
# | |
# Chris Weyl <[email protected]> 2010. | |
use common::sense; | |
use autodie 'system'; | |
use opts; |
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
has config => ( | |
traits => ['Hash'], | |
is => 'bare', | |
isa => 'HashRef[Str]', | |
lazy => 1, | |
# returns a hashref of key/value config pairs | |
builder => 'load_config', | |
handles => { |
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
# ta-da! | |
has expensive_value => (is => 'ro', lazy_build => 1); | |
sub _build_foo { ... something expensive ... } |
OlderNewer