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 | |
use warnings; | |
use strict; | |
#make module name directory | |
if (!$ARGV[0]) { | |
die "given no module name"; | |
} | |
my $module_name = $ARGV[0]; | |
my $permissions = "0755"; |
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
#Makefile.PL | |
use strict; | |
use inc::Module::Install; #makefile writer module | |
name('Example-Software'); #describe module name | |
all_from('lib/Example/Software.pm'); #file include meta data | |
requires('Hoge'); #required module | |
requires('Hoga', '1.00'); |
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 | |
package Coffee; | |
use Moose; | |
has 'beans' => ( | |
is => 'rw', | |
isa => 'ArrayRef' | |
); | |
__PACKAGE__->meta->make_immutable; |
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 | |
# | |
# Database CRUD test using DBIx::Class module | |
# | |
use strict; | |
use My::Schema; | |
my $schema = My::Schema->connect('dbi:SQLite:./test.db'); | |
# [C]RUD: create new row at 'Album' table |
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
sub edit_user { | |
my ($self, $update_info) = @_; | |
if (!%$update_info) { | |
return; #ERROR | |
} | |
#TODO validate update_info | |
my $user_obj = models('User')->update(%$update_info); |
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
#!/bin/sh | |
grep -irl 'match_twit' ./t | xargs -n 1 sh forxargs.sh |
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
use strict; | |
use warnings; | |
#use AnyEvent; | |
use AnyEvent::Strict; | |
use AnyEvent::Run; | |
my $match_time_start = AnyEvent->condvar; | |
my $wait_game_change; | |
$wait_game_change = AnyEvent::Run->new( |
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 MatchScraper; | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use HTML::TreeBuilder::XPath; | |
my $tree = HTML::TreeBuilder::XPath->new; | |
sub scrape { | |
my $url = shift; |
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
use strict; | |
use GD::Graph::bars; | |
use Path::Class qw(dir); | |
my $dir = dir('.'); | |
my $handle = $dir->open; | |
while (my $file = $handle->read) { | |
next unless $_ =‾ /log$/; |
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
for each(var o:* in sprite.getChildren()) { | |
if(o as MyClass) { | |
trace('here!'); | |
} | |
} |
OlderNewer