After my last post about Sub::Call::Tail melo and jrockway both asked me whether I was aware of Clojure's recur form. I wasn't. Shortly afterwords I wrote Sub::Call::Recur, which implements that form in Perl. The recur operation is a tail call to the current subroutine. It's a bit like Perl's redo builtin, but for functions instead of blocks. Here is a tail recursive factorial implementation: sub
Stuff I've stumbled on or figured out... mostly Perl, Linux, Mac and Cygwin. About Me Name: Mark Location: CA, United States Perl hacker, investor and entrepreneur. View my complete profile I'm sure the Padre developers weren't hoping to have their code absconded for those of us addicted to vim, but tsee's recent blog post on refactoring with Padre's lexical variable replace made me jealous--I wan
The personal website of Piers Cawley (they/him) — Folk singer, photographer, carer and occasional programmer. ‘Moose for Ruby Programmers’ was the programmed title for the talk I gave at the London.pm technical meet on Thursday, but that was something of a stalking horse for the real title, but I’ll save that for the end of this writeup. Why Ruby? I’ve said this before, and I’ll no doubt say it ag
Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at
Ben Tilly iwe@warhead.org.uk Fri, 29 Jul 2005 09:40:44 -0700 Previous message: [IWE] Knight down again? Next message: [IWE] Goodbye News World International Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] MJD is one of the well-known Perl hackers. He's also just written a very good book called Higher Order Perl. Here's his take on what is great about Lisp's macro system. Cheers, Ben
First of all, a disclaimer: I know “larsen” (Stefano Rodighiero) not just as an ex-colleague (he is one of the most respected senior programmers at DADA in Italy), or through the Italian Perl community, but also as a good friend. But of course, those were excellent reasons to look forward to his book: an introduction to Perl in a pocket series of roughly the same format and price point as the UK T
#coderepos で、「怪しい名前空間w」と言われてしまいましたが(^^;; Util系のモジュールがPerlにいくつかあって、便利なんだけど、紛らわしいというか、覚えてなくて、毎度調べるみたいなことがあります。 たとえば、List::UtilとList::MoreUtils。 「uniq関数どっちやったけ...?」 みたいな。そんな、わずらわしさを解消するために、Util::Any というものを作ってみました。 まとめるだけじゃ芸が無いので、まとめるモジュールを自作しやすいようにしてみました。 CPAN http://search.cpan.org/dist/Util-Any CodeRepos http://coderepos.org/share/browser/lang/perl/Util-Any/trunk/ 使い方は非常に簡単。 use Util::Any qw/list/;
Getting Started Catalyst overview Necessary background knowledge Installing Catalyst or getting a binary build Deploying Catalyst Applications Catalyst tutorial Catalyst Flow Chart and Catalyst redispatch diagrams Catalyst forward/detach/visit/go FAQ - general questions about Catalyst that can be answered in a few lines Recommended Plugins - Recommended plugins to solve common tasks for production
Method::Signatures's benchmark Method::SignaturesというPerlのメソッド定義や関数定義を直感的でかつ書き易く行う事が出来るcool moduleがあります。 たとえば sub lopnor { # DBIx::Class test code style my($self, %args) = @_; $self->{danjou} = $args{danjou}; }といったコードをmethod lopnor (:$danjou) { $self->{danjou} = $danjou; }という風に書けます。いいかんじじゃないっすか? このほどschwernによるプレゼン資料の中にM::S is 1% slowerとか書いてあったのでベンチ取ってみた。 use strict; use warnings; package My::Faster
Perl › 日付・時刻 存在する日付かどうかを簡単に判定するには、Time::Localモジュールを利用します。 Time::Localのtimelocal関数は指定した日付をエポックからの経過秒に変換する関数ですが、存在しない日付を指定すると例外を投げます。 このことを利用すると存在する日付の判定を行うことができます。 use strict; use warnings; use Time::Local 'timelocal'; print "(1)存在する日付かどうかを確認する。\n"; # Perlでは時刻は1900年からの経過年数で扱うので # 1900を引く。 my $year = 2008 -1900; # 月は0から始まるので、求めたい月から1を引く。 my $mon = 10 - 1; # そんな日はないはず。 my $mday = 32; # 存在しない日を指定すると例外
UTF8 フラグについてわかってるつもりだったんですが,utf8::is_utf8 considered harmful - Bulknews::Subtech - subtech を読んで混乱したので,自分なりにまとめてみました。間違いがありましたらご指摘よろしく。 まとめ スカラー変数の内部表象の状態を示すものとして UTF8 フラグというものがある スカラー変数は(リファレンス等は別として)下記のものを格納できる (A) 文字列(内部表象: UTF-8) (B) 文字列(内部表象: ISO-8859-1) (C) バイナリ列 純粋なバイナリストリーム(画像ファイル等)かもしれないし, UTF-8 octet stream かもしれないし, CP932 octet stream かもしれないし,etc, etc ... Perl は(後方互換性確保などの理由から)ISO-8859-1
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く