翻(雖然並沒有紙) 了一下 Passenger 的 Apache 文件,注意到一些可能可以用的選項,做了一些嘗試後,心得如下
October 2009 Archives
From time to time I’m just being lazy to properly declare module dependencies in Makefile.PL
, I do this to install required perl modules:
cpanp -i `grep "^use " -r lib -h |cut -b 5-80|perl -pe 's/[ ;].*$//'|grep -v -E '(utf8|warnings|strict)' | sort | uniq`
This command should work with bash and zsh. Of course it does not cover all cases, it is just a cute, with certain definition of, hack.
Just played Plack a bit and get a crufty app.psgi
for Jifty apps. This can be placed in your Jifty app dir and run with plackup --app app.psgi
, but you’ll have to modify the line that sets JIFTY_APP_ROOT
environment variable to your Jifty app path.
I hope this, and Jifty core, can be polished little bit so I don’t have to localize *ENV and *STDOUT there.
Also, I tried this with mod_psgi, not working, always returning ABORT from dispatcher, very weird.
Keep hacking.
Perl 5.11 多了一個「好棒好棒運算子 (Yada Yada Operator)」,寫做「…」(點點點)。它的做用是讓程式設計師能有效註明「這裡我還沒寫好」。如:
sub difficult_function { ... }
difficult_function();
此程式輸出如:
Unimplemented at yada.pl line 1.
從此之後大家可以放心在範例程式裡寫點點點了。
Update: 如果有人好奇這個運算子為何叫做「Yada Yada」,那是因為這個片語的意思便是「無聊、空泛的言語」之意(參考這裡),跟「blah blah」一樣。本文標題戲譯為「好棒好棒」是取「Yatta!」這個日文表情之諧音,不過顯然會有些誤導,特此加註。
Jesse Vincent 發佈了 Perl 5.11.0 版本,這是一個「開發型」版本。其目的在於漸進而確實地發展出 Perl 5.12 版,並且,在到達之前,讓開發者能以未來版的 Perl 測試自己的程式,確保相容無誤。
為了契合此目的,發佈流程也做了許多調整。整個 5.11.x 版的發佈流程將以月為單位,每個月 20 號都會釋出一次新版,下一版 5.11.1 的釋出日期是十月20日,5.11.2 則為十一月 20 日。
我在此鼓勵各位立刻開始安裝 5.11 版的 Perl,並以其測試自己的程式。為了避免與已安裝在系統上的 Perl 衝突,可參考 Install perl to $HOME 這篇文章的做法,將 Perl 安裝到指定目錄去。
It is possible to write such sigil-less perl program:
foo = 42;
say foo;
The trick is to declare foo
as a lvalue sub:
my $foo;
sub foo :lvalue { $foo }
Since $foo
is a scalar, it works for hashref and arrayref too:
foo = { ans => 42 };
say foo->{ans}
# => 42
foo = [42, 43, 44]
say foo->[0]
# => 42
This appears to me an interesting smell of a new PerlX module.