This file contains hidden or 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 File::Spec; | |
my @candidates = ( | |
File::Spec->catfile('/', 'usr', 'bin', 'zip'), | |
File::Spec->catfile('/', 'usr', 'local', 'bin', 'zip'), | |
File::Spec->catfile('C:', 'bin', 'zip'), # for Windows | |
); |
This file contains hidden or 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 main; | |
use Moops; | |
class Character { | |
has name => (is => 'ro', isa => Str); | |
method BUILD ($p) { | |
my $race = $p->{race} // 'Human'; | |
Moo::Role->apply_roles_to_object($self, "Race::$race"); | |
} | |
} |
This file contains hidden or 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
dSP; | |
int count; | |
SV *ret; | |
bool can; | |
SV *method_name = newSV(0); | |
sv_setpv(SV*, "MATCH"); | |
ENTER; | |
SAVETMPS; | |
PUSHMARK(SP); |
This file contains hidden or 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
dSP; | |
int count; | |
SV *ret; | |
bool can; | |
SV *method_name = newSV(0); | |
sv_setpv(SV*, "MATCH"); | |
ENTER; | |
SAVETMPS; | |
PUSHMARK(SP); |
This file contains hidden or 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 feature qw(state) | |
use Types::Standard qw(-all); | |
use Type::Params qw(compile); | |
sub yada { | |
state $check = compile Value, ArrayRef, Optional[HashRef]; | |
my (...) = $check->(@_); | |
...; | |
} |
This file contains hidden or 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
#include "EXTERN.h" | |
#include "perl.h" | |
#include "XSUB.h" | |
#include "ppport.h" | |
#include "const-c.inc" | |
int _mycall (char* methodname, SV* args[], int argc, int gimme) | |
{ |
This file contains hidden or 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
{ | |
my $_only_called_in_calc = sub { | |
...; | |
}; | |
sub calc { | |
my $result = $_only_called_in_calc->(1,2,3); | |
...; | |
} | |
} |
This file contains hidden or 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; | |
{ | |
package Event; | |
use Moose; | |
use Types::Standard qw( Str ); | |
use Types::XSD qw( Date ); | |
has start_date => ( |
This file contains hidden or 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
<!-- Generated by CGI::FormBuilder v3.09 available from www.formbuilder.org --> | |
<form method="post" onsubmit="return validate(this);"> | |
<div><input id="_submitted" name="_submitted" type="hidden" value="1" /></div> | |
<table> | |
<tr valign="top"> | |
<td><b>Activity Desc</b></td> | |
<td><input id="activity_desc" name="activity_desc" type="text" value="Other" /></td> | |
</tr> | |
<tr valign="top"> | |
<td><b>Historic</b></td> |
This file contains hidden or 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
simple_crud( | |
record_title => $source, | |
prefix => "/lookup/$table", | |
db_table => $table, | |
key_column => do { my @cols = $class->primary_columns; @cols==1 or die; $cols[0] }, | |
editable => true, # TODO: need auth! | |
deletable => false, | |
downloadable => true, | |
paginate => undef, | |
); |
OlderNewer