Perlのprintfまとめ

まとめって言われても、元ネタがわからないかもしれませんが。発端はこれ。っていうか、俺が始めたスレッドです。
http://www.freeml.com/message/perl@freeml.com/0006023;jsessionid=kyv4lb0l62

printf "%d\n", 0x80000000;

とすると、負の数が表示されます。これをはじめてみたときにはすごく驚きました。なんでそんなことになるの?みたいな。
もしこれが、Cとかであれば納得できますよね。負の数は正の数の2の補数表現を用いて実装されているわけですから、0x80000000は最上位ビットが1、すなわち負の数となるわけです(intが4バイトの場合)。でも、Perlですよ?Perlって基本的に整数型とか持ってないわけですよ。もちろん無いわけじゃないし、それを行なうための方法とかもあるわけですが、使用者はそれを意識せずに使うことが出来る。なのにどうしてなのかしら。
http://www.perldoc.com/perl5.8.4/pod/func/sprintf.htmlにその答えらしきものがあります。

Perl does its own sprintf formatting--it emulates the C function sprintf, but it doesn't use it (except for floating-point numbers, and even then only the standard modifiers are allowed). As a result, any non-standard extensions in your local sprintf are not available from Perl.
訳):PerlはCのsprintfをエミュレートしますが、Cのsprintfを使うわけではなく、独自のフォーマットを行ないます(不動小数点数だけは例外で、普通の形のみ記述できます)。ということで、あなたのローカル環境の特殊なsprintfの拡張構文をPerlから使うことは出来ません。

Cのsprintfをエミュレートしていると書いてある。つまり、Cの場合と全く同じ動作をするってことだ。でもどうして?intが4バイトっていうのは使いにくいじゃん。少なくともPerlから使いやすいとは到底思えない。でしょ?で、試しにこれをPHPだとどうなるかを実験してみたところ、PHPでも全く同じ動作をするようだった。ちなみにPHPのマニュアル(http://jp2.php.net/sprintf)には、大きな整数の場合の扱いなどはどこにも書いてない。
大学のコンピューター上のmanでは以下のように記述されていた。

diouxX The int (or appropriate variant) argument is converted to signed
decimal (d and i), unsigned octal (o), unsigned decimal (u), or
unsigned hexadecimal (x and X) notation. The letters ``abcdef''
are used for x conversions; the letters ``ABCDEF'' are used for X
conversions. The precision, if any, gives the minimum number of
digits that must appear; if the converted value requires fewer
digits, it is padded on the left with zeros.

とりあえず、%dというのはsigned intということを意味しているらしい。なので、Perlの場合もそれに準じた形となると言うことのようだ。とりあえず、今日はここまで。