Skip to content

Instantly share code, notes, and snippets.

View tobyink's full-sized avatar
🦈
hi

Toby Inkster tobyink

🦈
hi
View GitHub Profile
use strict;
use warnings;
use JSON;
my $a = [1,2,3];
my $b = {a => $a};
push @$a, $b;
print to_json $a;
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use HTML::HTML5::Parser;
use HTML::HTML5::Writer;
use Pod::Simple;
use Syntax::Highlight::Engine::Kate;
use v5.14;
use strict;
use warnings;
package My::Role
{
use Moose::Role;
my $some_val;
sub has_my {
my ( $self, $value ) = @_;
{
package SoundSwarm::Syntax;
no thanks;
use Syntax::Collector -collect => q/
use Carp 0 qw( confess );
use Scalar::Util 0 qw( blessed );
use MooX::Types::MooseLike::Base 0 qw( :all );
/;
}
@tobyink
tobyink / nopaste
Created February 15, 2013 12:32
git diff master delegation-overwriting-rt81181
diff --git a/Changes b/Changes
index 09d39ba..f9a8b4c 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+ - has will refuse to overwrite locally defined subs with generated
+ accessors.
- expand is => 'lazy' doc to make it clear that you can make rw lazy
attributes if you really want to
- handles => "RoleName" tries to load the module
use v5.14;
use Test::More;
package MooseX::IgnoreFalse::Trait::Attribute
{
use Moose::Role;
after _process_options => sub
{
my ($class, $name, $options) = @_;
use v5.14;
use warnings;
use HTML::Tags;
package MyWeb::Homepage {
sub get_html {
<html>, "Please pay at the checkout", </html>;
}
}
use strict;
use warnings;
sub abc {
<html>, "Hello", </html>;
}
sub xyz {
use HTML::Tags;
abc();
<tr class="class">
<td style="width:8%;"><a href="page.com" class="hyperlink">ABC</a></td>
<td style="width:10%;">1</td>
<td style="width:8%;">2</td>
<td style="width:8%;">3</td>
<td style="width:8%;">4</td>
<td style="width:8%;">5</td>
<td style="width:8%;">6</td>
<td style="width:12%;">7</td>
</tr>
@tobyink
tobyink / my-cpan-rev-deps.pl
Created March 4, 2013 22:24
MetaCPAN query to find all my distributions which depend on X, where X is some module I've decided to stop using.
#!/usr/bin/env perl
use v5.10;
use strict;
use warnings;
use HTTP::Tiny;
use JSON;
my @fields = qw< distribution version date >;