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
% wget http://search.cpan.org/CPAN/authors/id/M/MA/MAKAMAKA/JSON-PP-2.27202.tar.gz | |
% tar xzf JSON-PP-2.27202.tar.gz | |
% cd JSON-PP-2.27202 | |
% echo 5.8.6 > .perl-version | |
% perl -Ilib -MJSON::PP -e 'JSON::PP->new->decode(qq|{ "a":0, "b":"\x{c0}" }|)' && echo OK | |
, or } expected while parsing object/hash, at character offset 7 (before ", "b":"\x{c0}" }") at -e line 1. | |
% echo 5.8.7 > .perl-version |
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 strict; | |
use warnings; | |
use 5.016; | |
use AnyEvent::HTTP; | |
$|++; | |
$AnyEvent::HTTP::MAX_PER_HOST = 8; | |
for my $i (1..100) { | |
http_get 'http://shoichi.me:5000', timeout => 10 => sub { |
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 strict; | |
use warnings; | |
sub say { print @_, "\n" } | |
my @FIELD = qw( ip - user time req code size ref ua ); | |
my %FIELD = map { $_ => 1 } @FIELD; | |
my @want = grep { exists $FIELD{$_} || help() } split /,/, shift or help(); | |
while (<STDIN>) { |
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 strict; | |
use warnings; | |
use utf8; | |
use Fcntl qw(:DEFAULT :seek :flock); | |
use autodie qw(:io); | |
my $file = shift or die "missing file name"; | |
sysopen my $fh, $file, O_RDWR; |
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
✗ vim --version 06/07 01:02 | |
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26 2012 16:45:32) | |
Included patches: 1-547 | |
Modified by pkg-vim-maintainers@lists.alioth.debian.org | |
Compiled by buildd@ | |
Huge version with GTK2-GNOME GUI. Features included (+) or not (-): | |
bin/ | |
├── ex -> vim | |
├── rview -> vim |
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 strict; | |
use warnings; | |
use utf8; | |
use Net::SSLeay; | |
use feature qw(say); | |
my $host = shift || 'www.google.co.jp'; | |
my $port = shift || 443; | |
my $req = 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
diff --git bin/plenv-install bin/plenv-install | |
index 3055311..630f9c1 100755 | |
--- bin/plenv-install | |
+++ bin/plenv-install | |
@@ -44,6 +44,8 @@ sub main { | |
'version!' => \my $version, | |
'h|help' => \my $help, | |
'l|list' => \my $list, | |
+ 'as=s' => \my $as, | |
+ 'test' => \my $test, |
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 | |
DIR=`/usr/bin/perl -MCwd -MFile::Basename -e 'print dirname Cwd::abs_path shift' $0` | |
export PATH=$DIR/local/bin:$PATH | |
export PERL5LIB=$DIR/local/lib/perl5 | |
exec perl app.pl |
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 Fork; | |
use strict; | |
use warnings; | |
use IO::Pipe; | |
use Time::HiRes (); | |
sub run { | |
(undef, my %opt) = @_; | |
my $name = $opt{name} || 'Fork'; | |
my $worker = $opt{worker} || 5; |
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
#ifndef __DIE_H__ | |
#define __DIE_H__ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
#define die(msg) { \ | |
if (errno) { \ |