タグ

関連タグで絞り込む (327)

タグの絞り込みを解除

perlに関するtyruのブックマーク (886)

  • indirect object notationでハマらないためのno indirectプラグマ - Sexually Knowing


    Perl require_ok  require_ok   (?) indirect object notation  : package App::Logger; use Exporter 'import'; our @EXPORT = qw(INFO); sub INFO ($;@) { ... } 1; package App::Loader::User; sub
    indirect object notationでハマらないためのno indirectプラグマ - Sexually Knowing
    tyru
    tyru 2016/11/11
  • YappoLogs: xlsx ファイルを git diff しやすくする為の天才的な wrapper script を書いた


     xlsx 使 使 UI web   TSV  CSV  xlsx   xslx   xslx git diff  h
    tyru
    tyru 2014/06/20
    ExcelDiff for WinMerge みたいな git diff で使えるやつ。Perl製。
  • usleep - micro秒指定でsleep - うまいぼうぶろぐ


    1/10sleep usleep 100000perl perl -e 'select(undef,undef,undef,1/10)'  ref. http://d.hatena.ne.jp/hogem/20090316/1237174010
    usleep - micro秒指定でsleep - うまいぼうぶろぐ
    tyru
    tyru 2014/04/13
    あまりパッケージ入れたくない環境だったので、自分にとってはむしろperlでのやり方が有用だった。>perl -e 'select(undef,undef,undef,1/10)'
  • Vim で現在カーソルがあるテストメソッドを実行する - Sexually Knowing

    Perl には Test::Class という JUnit 風にテストを書けるモジュールがある。すなわち: テスト用のクラスを定義し アサーションをインスタンスメソッドとして括り出す ことができる。 Test::Class はテスト実行時に環境変数 TEST_METHOD に与えられた値で実行するテストメソッドをフィルタリングすることができる。 Sometimes you just want to run a single test. Commenting out other tests or writing code to skip them can be a hassle, so you can specify the TEST_METHOD environment variable. The value is expected to be a valid regular expres

    Vim で現在カーソルがあるテストメソッドを実行する - Sexually Knowing
  • Perlリファクタリングツール作ってる - hitode909の日記


    GIF Perlperl-refactoring-tools GitHub - hitode909/App-PRT: Command line tool for Perl code refactoring App::PRT GitHub - hitode909/App-PRT: Command line tool for Perl code refactoring  100%hitode909/App-PRT | Coveralls - Test Coverage History & Statistics  
    Perlリファクタリングツール作ってる - hitode909の日記
    tyru
    tyru 2014/03/23
  • 正規表現によるバリデーションでは ^ と $ ではなく \A と \z を使おう


     ^  $  \A  \z Ruby ^  $ 使PerlPHPRuby \A  \z 使  PHPerRuby/RailsRuby ^  $ RubyonRails Security GuideXSShttphttpsURL /^https?:\/\/[^\n]+$/
    tyru
    tyru 2014/03/04
    Rubyの正規表現ってデフォルトで複数行モードなんだ。知らなかった。
  • anyenvで開発環境を整える - Qiita


      perl, ruby, nodejs, python  plenv, rbenv, nodebrew, pyenv   anyenv  **env2使使 http://blog.riywo.com/2013/06/22/155804 https://github.com/riywo/anyenv  README.md OK # ------------------------------------------------------------------------ -# plenv +# an
    anyenvで開発環境を整える - Qiita
    tyru
    tyru 2014/02/20
    plenv, rbenv, nodebrew, pyenvをこれ一つで / vimenvにも対応してほしい
  • Big Sky :: PerlでWindowsと親和性の高いreadlineが欲しい → あった「Caroline」

    readline って言うと、便利な反面 Windows だと問題が多く発生して、Windows でも動かすスクリプトでの使用は敬遠してたんですが、Caroline だと多い日も安心。 tokuhirom/Caroline - GitHub Yet another line editing library https://github.com/tokuhirom/Caroline readline なんかと違って、内部は utf-8 なので unix 等のスクリプトと同じ動きをします。ヒストリも保存出来るし、入力補完も自作出来ます。 eg/suddenly_death.pl を見るといいです。 $ perl -Ilib eg/suddenly_death.pl hello> ここで m を入力してタブキーをタイプすると... $ perl -Ilib eg/suddenly_death.p

    Big Sky :: PerlでWindowsと親和性の高いreadlineが欲しい → あった「Caroline」
  • cpanfile の構文を watchdogs.vim (+ quickrun.vim) で検証する - Sexually Knowing


     Perl  cpanfile *1 cpanfile  cpanfile   Perl  `requires`   Module::CPANfile 使 use Module::CPANfile; Module::CPANfile->load; watchdogs.vim 使: let g:quickrun_config['watchdogs_checker/cpanfile'] = { \ 'command' : 'p
    cpanfile の構文を watchdogs.vim (+ quickrun.vim) で検証する - Sexually Knowing
    tyru
    tyru 2013/08/10
  • TAP::Harnessの結果を左右反転して出力するTAP::Formatter - hitode909の日記

    Perlのテスト実行するときproveとかやると何か結果が出るけど,これの出力するのをプログラムから操作したいと思って,TAP::Harness読んでた. TAP::Harnessのコンストラクタに自作のformatter_class(これはテストが終わったときに結果を整形するクラス)を渡して,formatte_classのopen_testの返り値で自作のSessionクラス(これは一行ずつ呼ばれるやつ)を渡すと,Sessionクラスのresultに各行のオブジェクトがやってくることが分かった.merge => 1すると テスト失敗したときに構造化されずに出てくる# Failed test みたいなのもSessionで受け取れる.必要な分だけ書きたいのでデフォルトのクラスを継承してちょっとだけ書く. 意味ないけど,とりあえず,出力が左右判定するproveみたいなの作っておいた.これ自体に

    TAP::Harnessの結果を左右反転して出力するTAP::Formatter - hitode909の日記
  • http://nyaos.org/d/index.cgi?p=(2008.11.09)

    tyru
    tyru 2013/05/05
  • Perl, あるいは困ることについて - Kato Kazuyoshi


    Q2 1  Perl 2  PSGI/Plack, cpanminus, carton, cpanfile Perl  Ruby  Rack, gem (1), Bundler, Gemfile   Module Counts Moose  Perl5 Stevan Little  Perl is not Dead, itis a Dead End 退 Perl 
    tyru
    tyru 2013/04/02
  • Perl 5.16.3 and 5.14.4 just released – Perl News

    Perl 5.16.3 has just been released including the fix for the Rehashing flaw and is a recommended update for all 5.16 users. Perl 5.14.4 has also been released, again fixing the Rehashing Flaw and is a recommended update for all 5.14 users. These updates will be mirrored to your local CPAN mirror in the next few hours.

    Perl 5.16.3 and 5.14.4 just released – Perl News
    tyru
    tyru 2013/03/13
    security updateきてたのこれかー via http://space.hatena.ne.jp/~/14290001378108533089
  • テストにコケる度にシーザーが死ぬ仕組みを作りました - その手の平は尻もつかめるさ


     App::WithSound  https://github.com/moznion/App--WithSound https://metacpan.org/module/MOZNION/App-WithSound-v1.0.2/with-sound (2013.03.06 ) App::WithSound v1.1.0   https://metacpan.org/module/MOZNION/App-WithSound-v1.1.0/with-sound () App::WithSound?  m
    テストにコケる度にシーザーが死ぬ仕組みを作りました - その手の平は尻もつかめるさ
  • Perlの食えない事情 - 演算子編 - アリ


    Perl  PerlPerl : 0+, +0  使Perlscalar print 0+ '10'; #=> 10 print 0+ '123b'; #=> 123 print '1.2e3' +0; #=> 1200 print [] +0; #=> 4303367864  $obj.q();  $obj . '';  : @{[ ]} 
    Perlの食えない事情 - 演算子編 - アリ
    tyru
    tyru 2013/02/05
    演算子の組み合わせでよくこれだけ複雑なことができるなーと
  • Terminal Hero

    Readme Dependencies This game is written in Perl language, so it depends on Perl interpreter. It also needs libtermkey and some extra Perl modules: Term::ReadKey Term::TermKey POE POE::Wheel::TermKey If you don't know how to install Perl modules, look at How to install CPAN modules. If you have problems with installation of Term::TermKey, make sure that libtermkey is available in your operating sy

    tyru
    tyru 2013/01/27
    インストールしてみたけどむずい
  • Perlでは何が定数なのか - D-6 [相変わらず根無し]

    生のハッシュリファレンスを return したら遅い コメントを残せないブログなんて!どうなの!と、それは置いておいて、Perlでconstant foldingされるのは文字列・数値リテラルか、定数扱いできる関数だけです。 定数扱いできる関数というのは実は決まっていて、以下の条件がそろわないとconstant folding されない: その関数は 引数を取らない、とprototypeで明示的に宣言してあるその関数は文字列・数値リテラルを返し、それ以外の処理を行わないこちらのコードを実行してみるとわかりやすいuse strict; use O ('Deparse'); sub not_const { 1 } sub const_num() { 1 } sub const_string() { "foo" } sub const_list() { [ qw(1 2 3) ] } sub

    tyru
    tyru 2013/01/12
  • 生のハッシュリファレンスを return したら遅い

    ハッシュリファレンスは畳み込み的に定数扱いじゃなかったのね、ってのに気づいて驚いた(というのが当に遅い原因か確定させて無いけど)(【追記2】参照)。 #!/usr/bin/perl use strict; use warnings; use Benchmark qw/timethese cmpthese/; my $HASH = { foo => 123, bar => 456, baz => 789, }; my $result = timethese (750_000, { 'VAL' => '&logic1;', 'RAW' => '&logic2;', }); cmpthese $result; sub logic1 { _logic1()->{foo}; } sub _logic1 { return $HASH; } sub logic2 { _logic2()->{foo};

    生のハッシュリファレンスを return したら遅い
    tyru
    tyru 2013/01/12
  • YogafireというAWSツールでヨガの奥義を極める - Perl勉強メモ アルパカDiary出張版

    ※注 タイトルに深い意味はありません https://github.com/toritori0318/p5-Yogafire だいぶ前からgithubには置いてたんですが 年始だしドキュメントっぽいのを書いてみることにしました。 超長い!でも便利かも! 前置き 仕事AWS(EC2)を使うことが多いのですが、 自分で使っていて「こんなんあったら便利かなー」というのを寄せ集めたCLIです。 基的な考え方としては「EC2をタグNameベースで」いろいろと操作できるようなツールですね。*1 *2 貧乏性な自分はスポットインスタンスを定常的に使うので yoga sshは割と必須だったりしています。 ※Windows たぶん動きません! インストール cpanm https://github.com/toritori0318/p5-Yogafire/tarball/master # cpanm無い

    YogafireというAWSツールでヨガの奥義を極める - Perl勉強メモ アルパカDiary出張版
    tyru
    tyru 2013/01/04
  • Shipped Mail::Krohn 0.01 - tokuhirom's blog

    Mail::Krohn is alternative library for Email::Sender. I don't want to use Email::Sender since it depends on Moose. I want to run our application in tight memory. Some of the developers call the sendmail command by himself. Mail::Krohn is minimized version of Email::Send. But all required features for most web applications are supported(I hope). Enjoy! 【追記】 Now, Email::Sender was switched to Moo. I

    tyru
    tyru 2013/01/01