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
| $ perl -MEncode -le "print $Encode::VERSION" | |
| function cpanv (){ | |
| perl -M$1 -le "print \$$1::VERSION" | |
| } |
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
| perl -e 'print $^O' |
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
| #!/usr/bin/env perl | |
| =head1 NAME | |
| idezawaman.pl - | |
| =head1 WHY THIS NAME? | |
| 16:24 < Yappo> ちょっとしたツールかきたいのに良い名前が思い浮かばなくてかけてない | |
| 16:28 < teranishi> まかせなさい |
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
| % gdb --args perl `which plackup` app.psgi | |
| というわけで、テンプレートエンジンがSEGVする場合のうち、90% はテンプレートエンジン自体の問題ではありません。そこでまずは SEGV する原因をしらべるわけですが、SEGV する原因をしらべるには、gdb をつかうのが簡単です。 | |
| % gdb --args perl `which plackup` app.psgi | |
| などとして起動してから実際に SEGV をおとし、gdb がとまったところですかさず 'bt' コマンドをうちます(bt=backtrace)。この時、C レベルのスタックトレースがとれますが、このときに表示されているスタックトレースのログの一番上の方にのこっている部分に注目します。 |
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
| for h in \ | |
| hoge.pm \ | |
| foo.pm \ | |
| ; do echo $h; ssh {} cat /path/to/$h | diff - /path/to/$h ; done |
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
| sudo /usr/sbin/tcpdump -i bond0 -p -n 'udp and host hegheg' |
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
| perl -le 'sub test { print join ",", @_; } sub main { my $a = "test"; goto &$a; } main("Hello", "World");' |
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
| perl -le 'package L; use Class::Accessor::Lite (new =>1,rw => [qw/id name separator/]);package main; my $ret = L->new(id => 1); print $ret->id;' |
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
| #!/bin/sh | |
| echo `__git_ps1` | |
| if [ -r "/etc/bash_completion.d/git" ]; then | |
| git stash list 2>/dev/null | grep `__git_ps1 %s` | wc -l | |
| fi |
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変数を参照しているのがクロージャ。そうでないのが非クロージャ -> | |
| perl -MDevel::Peek -e 'my $x; our $y; Dump sub { $x }; Dump sub { $y }' |