何はともあれまずperlbrewを入れる
\curl -L http://install.perlbrew.pl | bash
echo 'source ~/perl5/perlbrew/etc/bashrc' >> .bashrc
source .bashrc
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Encode; | |
use YAML::Syck; | |
use TokyoCabinet; | |
use Text::KyTea; | |
use Unicode::Japanese; |
use strict; | |
use warnings; | |
use IO::Handle; | |
sub fork_exec { | |
my @args = @_; | |
my $handles = []; | |
if (ref($args[$#args]) eq 'GLOB') { | |
my $stdin = pop @args; |
code="console.log('code='+JSON.stringify(code)+';eval(code)')";eval(code) |
#define let(name,value) const __typeof__ (value) name = value; | |
#define var(name,value) __typeof__ (value) name = value; | |
int main(int argc, char *argv[]) { | |
let(x,3); // const int x = 3; | |
var(y,5); // int y = 5; | |
printf("x:%i y:%i",x,y); // -> x:3 y:5 | |
} |
extension String { | |
var lastPathComponent: String { | |
get { | |
return (self as NSString).lastPathComponent | |
} | |
} | |
var pathExtension: String { | |
Tracking memory leaks: | |
Devel::Arena - sv_stats() returns arena structures used for SV allocation | |
* Devel::Cycle - find_cycle($ref) returns all cycles found in $ref and the perl variables they point to | |
Devel::Gladiator - walk Perl variable arena | |
Devel::Leak - deprecated by Devel::LeakTrace::Fast | |
Devel::LeakTrace - deprecated by Devel::LeakTrace::Fast | |
* Devel::LeakTrace::Fast - prints leaked SV's and line numbers at END. | |
Data::Structure::Util - has_circular_ref($ref) returns ref to link in $ref that is circular or false. | |
Test::LeakTrace - no_leaks_ok(), etc. |
http { | |
include /etc/nginx/mime.types; | |
default_type application/octet-stream; | |
log_format ltsv 'domain:$host\t' | |
'host:$remote_addr\t' | |
'user:$remote_user\t' | |
'time:$time_local\t' | |
'method:$request_method\t' | |
'path:$request_uri\t' |
Perl ワンライナーサンプル集 | |
■概要 | |
障害解析のためのログの調査、非互換対応でのソースコードの調査といった | |
テキスト処理で使った Perl ワンライナーのサンプル集です。 | |
Perl ワンライナーは以下の点が良いと思います。 | |
・Perl は Oracle Database (10g以降) に同梱されている。 | |
従って、Windows プラットフォームでも使える。 |