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/local/bin/perl | |
# Quest for efficient usage of Data::Model - get by iterator vs. by list (vs. lookup) | |
use strict; | |
use warnings; | |
use Benchmark qw(cmpthese timethese); | |
use File::Temp; | |
my $db = "testdatabase_datamodel"; |
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 HTML::Shakan::Renderer::HTML::DefinitionList; | |
use Any::Moose; | |
# use HTML::Shakan::Utils; | |
extends qw( | |
HTML::Shakan::Renderer::HTML | |
); | |
with qw( | |
HTML::Shakan::Renderer::HTML::SelectivelyEncodable |
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 HTML::Shakan::Renderer::HTML::DateTimeSeparatable; | |
use Any::Moose '::Role'; | |
sub separate_datetime { | |
my ($self, $html) = @_; | |
$html =~ s{ | |
(</select>)([\n\s]*<select \s name="[^"]+_(?:month|day)">) | |
}{$1/$2}xmsg; | |
$html =~ s{ |
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 HTML::Shakan::Renderer::HTML::SelectivelyEncodable; | |
use HTML::Shakan::Utils; | |
use Any::Moose '::Role'; | |
sub selectively_encode { | |
my ($self, $label) = @_; | |
my $label_for_render = $label; | |
my $prefix = q{}; |
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 | |
# Which is fast to replace or split? | |
use strict; | |
use warnings; | |
use Benchmark qw(cmpthese timethese); | |
use DateTime::TimeZone; | |
use Scalar::Util; |
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/local/bin/perl | |
# sample code snippet to explain circular dependeded attributes (with role) | |
# see http://blog.eorzea.asia/2009/10/post_72.html | |
use strict; | |
use warnings; | |
use utf8; | |
{ | |
package MyApp::HasChristianEra; |
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/local/bin/perl | |
# sample code snippet to explain plurally dependeded attributes | |
# see http://blog.eorzea.asia/2009/10/post_72.html | |
use strict; | |
use warnings; | |
use utf8; | |
{ | |
package MyApp::Addressee; |
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
This is a BAD sample. | |
Use clearer method instead of rebuild mechanism! | |
See http://blog.eorzea.asia/2009/10/post_72.html for more details. |
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/local/bin/perl | |
# sample code snippet to explain one-way dependeded attributes | |
# see http://blog.eorzea.asia/2009/10/post_72.html | |
use strict; | |
use warnings; | |
use utf8; | |
{ | |
package MyApp::Authentication; |
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
Getting started with DBIx::Class::Schema::Loader |
OlderNewer