<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>DQNEO起業日記</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/" />
    <link rel="self" type="application/atom+xml" href="http://dqn.sakusakutto.jp/atom.xml" />
    <id>tag:dqn.sakusakutto.jp,2010-06-14://5</id>
    <updated>2010-09-08T19:08:53Z</updated>
    <subtitle>ど素人プログラマの挑戦。</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 5.02</generator>

<entry>
    <title>PerlとPHPにおける「リスト」概念の違い</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/09/perlphp.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.349</id>

    <published>2010-09-08T17:17:36Z</published>
    <updated>2010-09-08T19:08:53Z</updated>

    <summary>naoyaさんのPHP版 List_RubyLikeを見ていて面白いことに気づき...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="PHP" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[naoyaさんの<a href="http://d.hatena.ne.jp/naoya/20100905/1283662354">PHP版 List_RubyLike</a>を見ていて面白いことに気づきました。<br />
<br />
<pre><code>$list->push('foo');
$list->push('bar','buz');
</code></pre>
<br />
一瞬、「なんて美しい！」と思いました。<br />
と同時に、「なんてPerl的な！」とも思いました。<br />
「これじゃまるでPerlじゃないか」と。<br />
<br />
私ならこういうインターフェイスにすると思います。<br />
<br />
<pre><code>$list->push('foo');
$list->push(array('foo','bar'));
</code></pre>
<br />
少し冗長ですが、こっちの方がPHPとしてしっくりきます（私にとっては）。<br />
実際にはpush(array('foo','bar'))などとリテラルを渡すことはあまりなくて、push($hoge)とかpush($this->hoge())などと書くことになるでしょう。<br />
<br />
この違いを突き詰めていくと、「PerlとPHPにおけるリストの考え方が違うんだ」という面白い事実を発見しました。
<br />
<h4>PHPプログラマとPerlプログラマのものの見方の違い</h4>
<br />
<pre><code>func('foo', 'bar');</code></pre>
<br />
このコードを見たとき、<br />
PHPプログラマは「関数に２つの値を渡している」と考えます。<br />
一方、<br />
Perlプログラマも「関数に２つの値を渡している」と考えますが、<br />
同時に「関数に１つのリストを渡している」とも考えます。<br />
<br />
Perlにおいて、下記の２つのfunc呼び出しは同じ意味です。<br />
<br />
<pre><code>func(1,2,3);

my @list = (1,2,3);
func(@list);</code></pre>
<br />
ところがPHPにおいては、下記の２つのfunc呼び出しは意味が異なります。<br />
<br />
<pre><code>func(1,2,3);

$list = array(1,2,3);
func($list);</code></pre>

<h4>サンプルコード</h4>
<h5>Perl</h5>
<pre><code>use strict;
use Data::Dumper;

func(1,2,3);

my @list = (1,2,3);
func(@list);

sub func() {
    print Dumper \@_;
}

---結果---

$VAR1 = [
          1,
          2,
          3
        ];
$VAR1 = [
          1,
          2,
          3
        ];
</code></pre>

<h5>PHP</h5>
<pre><code>&lt;?php

func(1,2,3);

$list = array(1,2,3);
func($list);

function func() {
    $args = func_get_args();
    print_r($args);
}

---結果---
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
)
Array
(
    [0] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
        )

)

</code></pre>
もちろん、func_get_argsの戻り値に応じてif文で分岐すればPerlと同じ振る舞いをさせることはできます。<br />
しかしそこまでやってしまうとPHPらしくない気がします。<br />
何故かというと、PHPの配列関数(array_*系の組込み関数)はPerlのような「引数のリスト渡し」をサポートしていないからです。<br />

<h4>参考：Perlにおける配列とリストの違い</h4>
<blockquote><strong>リスト</strong>とは、スカラーの集合に順序を付けて並べたものです。<br />
<strong>配列</strong>とは、リストを保持する変数のことです。<br />
リストはデータであり、配列は変数であるという違いがあります。<br />
 --- 「初めてのPerl」３章 リストと配列</blockquote>

PHPでも「array型のデータ」と「arra型の変数」は異なる概念です。<br />
しかし「スカラーを並べたものをリストと呼ぶ」という考え方はない気がします。


<h4>結論</h4>
<ul>
	<li>PHPに「リスト」というものはない。ただarray型のデータとarray型の変数があるのみ。</li>
	<li>func_get_argsは@_の代わりにはならない。</li>
</ul>

※誤解のないように言っておくと、naoyaさんのList_RubyLikeを批判しているわけではありません。<br />
「PHPらしい、らしくない」はあくまで私の主観です。<br />
<br />
ご意見、ツッコミあればお願いします。]]>
        
    </content>
</entry>

<entry>
    <title>[PHP]Imagickのインストールエラーの対処法</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/08/phpimagick.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.348</id>

    <published>2010-08-01T04:12:15Z</published>
    <updated>2010-08-01T05:19:58Z</updated>

    <summary>CentOS 5.3、PHP5.1.6な環境でPECLでImagickをインスト...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="PHP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="imagemagick" label="ImageMagick" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="imagick" label="Imagick" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="pecl" label="PECL" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[CentOS 5.3、PHP5.1.6な環境でPECLでImagickをインストールしようとしたら下記のようなエラーが出た。

<pre><code># pecl install imagick
downloading imagick-3.0.0.tgz ...
Starting to download imagick-3.0.0.tgz (93,488 bytes)
.....................done: 93,488 bytes
13 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20050922
Zend Extension Api No:   220051025
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-root/imagick-3.0.0
running: /tmp/tmpGia3gn/imagick-3.0.0/configure --with-imagick
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-redhat-linux-gnu
checking host system type... i686-redhat-linux-gnu
checking target system type... i686-redhat-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking whether to enable the imagick GraphicsMagick backend... no
checking ImageMagick MagickWand API configuration program... found in /usr/bin/Wand-config
checking if ImageMagick version is at least 6.2.4... found version 6.2.8
checking for magick-wand.h header file... found in /usr/include/wand/magick-wand.h
<strong style="colore:red">
checking PHP version is at least 5.1.3... /tmp/tmpGia3gn/imagick-3.0.0/configure: line 3339: test:
 Usage: /usr/bin/php-config [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version]: integer expression expected
configure: error: no. found 5.1.6
ERROR: `/tmp/tmpGia3gn/imagick-3.0.0/configure --with-imagick' failed
</strong>
</code></pre>
<br />
エラーメッセージでGoogle検索しても全然事例が見つからない。<br />
大パニック。(><)<br />
<br />
ふと、PHP公式サイトのimagickインストールの項を見ていたらヒントがあった。<br />
<a href="http://www.php.net/manual/ja/imagick.installation.php">http://www.php.net/manual/ja/imagick.installation.php
</a>
<blockquote>vbsaltydog
31-Jul-2010 03:31

I could not install via PECL or compiling from source because of <strong style="color:red">an error from line 3339 of the configure file generated by phpize so I looked at the configure file at line 3339 and it was just a check for the PHP version using the php-config command with the --vernum switch which was not supported by my PHP version </strong>so I commented out that check from the configure file and then it would configure, compile, and install.

After installation, it put the shared object file in my php extension modules directory so I added an entry to my /etc/php.d directory to load the extension file and restarted apache and the imagick section is present in my info.php output.

</blockquote>

imagickのインストーラがPHPのバージョン確認しようとして、その"php-config --vernum"コマンドがこけているというのだ。<br />
<br />
imagickのバグ？peclのバグ? はたまたphpizeのバグ？・・・一瞬途方にくれた。<br />
<br />
しかしよく見ると、手動configure & コンパイルすればいけたと書いてあるのでやってみる。<br />
<br />
まず、PECLのサイトでソースパッケージを探す。<br />
<a href="http://pecl.php.net/package/imagick">http://pecl.php.net/package/imagick</a><br />
展開する
<pre><code># wget http://pecl.php.net/get/imagick-3.0.0.tgz
# tar xvfz imagick-3.0.0.tgz
# cd imagick-3.0.0
</code></pre>
<br />
ここでおもむろに、
<pre><code># ./configure
</code></pre>んー何も起こらん。<br />
<br />
<pre><code># pecl install .
</code></pre>これもダメ<br />
<br />
<pre><code># pecl install ../package.xml
ERROR: file ../examples/polygon.php does not exist
</code></pre>
お、一歩前進。<br />
<br />
<pre><code># cp ../package.xml
# pecl install package.xml
</code></pre>
をを、インストーラが起動した。<br />
最初と同じエラーが出た。<br />
<br />
これでめでたくディレクトリ内にconfigureファイルが生成された。<br />

<pre><code># cat configure -n

  3325
  3326    if test -z "${PHP_VERSION_ID}"; then
  3327      if test -z "${PHP_CONFIG}"; then
  3328        { { echo "$as_me:$LINENO: error: php-config not found" >&5
  3329  echo "$as_me: error: php-config not found" >&2;}
  3330     { (exit 1); exit 1; }; }
  3331      fi
  3332      PHP_IMAGICK_FOUND_VERNUM=`${PHP_CONFIG} --vernum`;
  3333      PHP_IMAGICK_FOUND_VERSION=`${PHP_CONFIG} --version`
  3334    else
  3335      PHP_IMAGICK_FOUND_VERNUM="${PHP_VERSION_ID}"
  3336      PHP_IMAGICK_FOUND_VERSION="${PHP_VERSION}"
  3337    fi
  3338
  3339    if test "$PHP_IMAGICK_FOUND_VERNUM" -ge "50103"; then
  3340      echo "$as_me:$LINENO: result: yes. found $PHP_IMAGICK_FOUND_VERSION" >&5
  3341  echo "${ECHO_T}yes. found $PHP_IMAGICK_FOUND_VERSION" >&6
  3342    else
  3343      { { echo "$as_me:$LINENO: error: no. found $PHP_IMAGICK_FOUND_VERSION" >&5
  3344  echo "$as_me: error: no. found $PHP_IMAGICK_FOUND_VERSION" >&2;}
  3345     { (exit 1); exit 1; }; }
  3346    fi
  3347
</code></pre>
3339行目あたりに注目。<br />
確かに、PHPのバージョンを確認するのに"php-config --vernum"のようなコマンドを実行している。<br />
<br />
試しに、手動でコマンドを実行してみる。
<pre><code># php-config --vernum
Usage: /usr/bin/php-config [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version]
</code></pre>
をを、最初のエラーと同じようなエラーが出た。<br />
<br />
なるほどこれが原因か。<br />
「php-config --vernumでバージョン番号を取得しようとしているが、--vernumオプションは存在しない。よってconfigureがコケる。」<br />
<br />
Imagickのバグか、PECLのバグか、phpizeのバグか、php-configのバグか、どれが真の原因なのかはわからないが、とりあえず修正することはできそうだ。<br />
<br />
とりあえず安直php-configを修正することにする。
<pre><code>$ which php-config
/usr/bin/php-config
$ nano /usr/bin/php-config

#! /bin/sh

prefix="/usr"
exec_prefix="/usr"
version="5.1.6"
<strong style="color:red">vernum="50106"</strong>
includedir="/usr/include/php"
includes="-I$includedir -I$includedir/main -I$includedir/TSRM -I$includedir/Zend -I$includedir/ext"
ldflags=" -L/usr/kerberos/lib"
libs="-lcrypt   -lcrypt -laspell -lpspell -lgmp -ldb-4.3 -lcurl -lbz2 -lz -lpcre -lresolv -lm -ldl -lnsl  -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lss$
extension_dir='/usr/lib/php/modules'
program_prefix=""
program_suffix=""
exe_extension=""
php_binary="/usr/bin/${program_prefix}php${program_suffix}${exe_extension}"

case "$1" in
--prefix)
        echo $prefix;;
--includes)
        echo $includes;;
--ldflags)
        echo $ldflags;;
--libs)
        echo $libs;;
--extension-dir)
        echo $extension_dir;;
--include-dir)
        echo $includedir;;
--php-binary)
        echo $php_binary;;
--version)
        echo $version;;
<strong style="color:red">--vernum)
        echo $vernum;;</strong>
*)
        echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version]"
        exit 1;;
esac

exit 0
</code></pre>
 
編集したら実行
<pre><code># php-config --vernum
50106
</code></pre>

成功！<br />
<br />
そして再度imagickをインストール。
<pre><code># pecl install imagick
</code></pre>

うまく行った！<br />
あとはphp.iniに<br />
extension=imagick.so<br />
を書けばOK！<br />
<br />
あ～解決できてよかった。。。]]>
        
    </content>
</entry>

<entry>
    <title>リファクタリングに失敗してとんでもないバグを入れてしまった orz</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/07/-orz.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.347</id>

    <published>2010-07-21T16:51:59Z</published>
    <updated>2010-07-21T18:08:30Z</updated>

    <summary>その悲劇は、PHPの巨大なクラスをリファクタリングしたのが原因で起こりました。 ...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="PHP" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="活動記録" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[<p>その悲劇は、PHPの巨大なクラスをリファクタリングしたのが原因で起こりました。</p>

<p><br />
「フォームの送信ボタンを連打すると発生するとDB上で２重登録されてしまうバグがあり、その問題に対処するために確認画面に遷移したときに重複レコードを削除することになっているはずが削除されない」というものでした。</p>

<p><br />
<h4>リファクタリング前のクラス</h4><br />
<pre><code>class myClass {<br />
   ...<br />
   function doSomething($user_id)<br />
   {<br />
           $sql1 = "SELECT  * FROM tb1 WHERE user_id = " . $user_id;<br />
           ....<br />
           $sql2 = "DELETE FROM  tbl1 WHERE user_id = " . $user_id;<br />
   }<br />
   ...<br />
}</code></pre></p>

<p><br />
<h4>リファクタリング後のクラス（バグ有り）</h4></p>

<pre><code>class myClass { 
　...

<p>   function doSomething()<br />
   {<br />
           $sql1 = "SELECT  * FROM tb1 WHERE user_id = " . $this->gerUserId();<br />
           ....<br />
           $sql2 = "DELETE FROM  tbl1 WHERE user_id = " . <strong style="color:red">$user_id;</strong><br />
   }<br />
   ...<br />
}<br />
</code></pre></p>

<p><br />
いわゆる「問い合わせによる一時変数の置き換え」をやろうとして、置換が漏れてました。</p>

<p>（$user_id を $this->getUserId()に置き換えたかった）</p>

<p>しかもこのバグを本番にアップして２ヶ月間も気づかず放置。</p>

<p>上記のDELETE文はSQL文法エラーで実行されず、消さなきゃいけないデータが２ヶ月も消えないまま残ってしまっていた。。。</p>

<p><br />
<h4>敗因</h4></p>

<p><br />
最初に頭によぎったことは、「Perlで書いてれば！！Perlなら絶対use strictって書くからこんなミスしないのに！！」<br />
こともあろうに私は言語のせいにしようとしました。</p>

<p>もちろんPHPに非があろうはずがありません。<br />
悪いのは私であって、言語ではありません。</p>

<p><br />
<h5>E_STRICTを有効にしてなかった</h5></p>

<p>Perlのuse strict;を羨むくらいなら、E_STRICTを有効にしておけばよかった。</p>

<p><br />
<h5>自動単体テストを書いていなかった</h5></p>

<p>リファクタリングには自動単体テストが必須なわけですが、私はこれを怠けたのです。<br /><br />
「それってリファクタリングちゃうやん」と言われたら、まったくその通りです。</p>

<p><br />
<h5>手動テストをしていなかった</h5></p>

<p>上記delete文がちゃんと機能しているかを確認する手動テストすらしていませんでした。<br />
典型的なEdit & Pray（編集して祈る）開発スタイル !!</p>

<p></p>

<p><br />
<h5>本番サーバでのエラーログを見てなかった</h5></p>

<p>上記スクリプトはSQL的に文法エラーなわけで、当然サーバのエラーログにもエラーが残っていました。<br />
しかしその文法エラーのエラー文を見ても、上記スクリプトが原因だと気づきませんでした。。。</p>

<p></p>

<p><br />
<h5>ユーザからの声に気づけず</h5></p>

<p>「動作がおかしい」という話をここ数週間聞いてたのですが、どうしてもバグが再現しないので「バグじゃないかもしれない」などと甘いことを考えていました。</p>

<p>本気でバグを探そうという気概が足りなかったのかもしれません。</p>

<p></p>

<p><br />
<h5>心がまえ</h5></p>

<p>「自分はリファクタリングに慣れてるからテストなんか書かなくても大丈夫」という慢心がありました。</p>

<p>この慢心がすべての原因のような気がします。（←これが言いたかった）</p>]]>
        
    </content>
</entry>

<entry>
    <title>携帯サイトでform送信できない場合の対処法</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/07/form.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.346</id>

    <published>2010-07-19T12:39:45Z</published>
    <updated>2010-07-19T12:43:35Z</updated>

    <summary>携帯サイトを作成しているときに、AUやドコモの端末でフォームの送信ができないこと...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
    <category term="form" label="Form" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="html" label="HTML," scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="携帯サイト" label="携帯サイト" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[携帯サイトを作成しているときに、AUやドコモの端末でフォームの送信ができないことがあります。<br />

DocomoのSH505iSでこの現象を確認しました。

<h4>症状</h4>
送信ボタンを押しても何の反応もない。

<h4>原因</h4>
<br />
formタグのaction属性を指定していない。<br />
<br />
例<br />
<code><pre>&lt;form&gt;
&lt;input ... /&gt;
&lt;input ... /&gt;
&lt;/form&gt;</pre></code>

<h4>対処法</h4>

formタグのaction属性をきちんと指定してやると、送信できます。<br />
<br />
<code><pre>&lt;form <strong>action="hoge.php"</strong>  &gt;
&lt;input ... /&gt;
&lt;input ... /&gt;
&lt;/form&gt;</pre></code>

<h4>FormのAction属性は必須です！</h4>
この現象は決してDocomoさんやSharpさんのせいではありません。<br />
<br />
HTMLの仕様上、form要素のaction属性は必須です。<br />
<a href="http://www.w3.org/TR/html401/interact/forms.html#edef-FORM">http://www.w3.org/TR/html401/interact/forms.html#edef-FORM
</a><br />
action属性はきちんと書きましょう！<br />

]]>
        
    </content>
</entry>

<entry>
    <title>携帯サイトでのbrタグの書き方の注意点</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/07/br.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.345</id>

    <published>2010-07-19T11:54:23Z</published>
    <updated>2010-07-19T12:01:39Z</updated>

    <summary>携帯サイトを作るときは、brタグの書き方に気をつけましょう。 正しい例 br と...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
    <category term="br" label="br" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="携帯サイト" label="携帯サイト" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[携帯サイトを作るときは、brタグの書き方に気をつけましょう。<br />
<br />
<h5>正しい例</h5>
br と /の間に半角スペース
<pre><code>&lt;br /&gt;
</code></pre><br />
<br />
<h5>悪い例</h5>
下記のように書くと改行されないことがあります<br />
<br />
<pre><code>&lt;br/&gt;
</code></pre><br />
<br />



]]>
        
    </content>
</entry>

<entry>
    <title>空メールからの会員登録でパラメータを渡す方法(Postfix)</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/07/postfix.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.344</id>

    <published>2010-07-19T03:09:36Z</published>
    <updated>2010-07-19T04:42:34Z</updated>

    <summary>携帯サイトで、空メールから会員登録するときに、あて先のメールアドレスを「reg+...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
    <category term="postfix" label="postfix" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[携帯サイトで、空メールから会員登録するときに、あて先のメールアドレスを「reg+12345@example.com」などとしてパラメータを渡すことができます。<br/>

<h4> 宛先メールアドレスの"+"以降をパラメータとして扱う </h4>

まず、"reg+123@"宛てに送っても"reg+foo@"宛てに送っても、"reg@"にメールが届くようにします。<br />
Gmailで使われているテクニックですね。<br/>
<br/>
<h5>main.cfを編集する</h5>
Postfixの/etc/postfix/main.cfの"recipient_delimiterという項目がコメントアウトされているので、
#を削除して有効にします。

<pre><code># recipient_delimiter = +</code></pre>
↓
<pre><code>recipient_delimiter = +</code></pre>

（Ubuntu9.04ではデフォルトで有効になっていました。)<br/>
<br/>
<h5>変更を反映させる</h5>
変更したらPostfixを再起動します。
<pre><code>/etc/init.d/postfix restart</code></pre>
<br/>
<h5>スクリプトでパラメータを抜き出す</h5>
あとは、PHPなどスクリプト側で、宛先メールアドレスを正規表現で解析します。

<pre><code>
/**
 *  "reg+12345@example.com"から"12345"部分を抜き出す
 */
function getParam($mailaddress)
{    
        if(preg_match('/reg\+(.+)/i', $mailaddress, $matched )) {
            return $matched[1];
        } else {
            return false;
        }
}
</code></pre>


<h4>参考</h4>
<a href="http://mtl.recruit.co.jp/blog/2009/06/post_31.html">ケータイサイトでメール送受信をする際のポイントをご紹介 : Media Technology Labs (MTL) : メディアテクノロジーラボ　ブログ</a>]]>
        
    </content>
</entry>

<entry>
    <title>[Postfix][自宅サーバ]Outbound port 25 Blocking対策してメール送信する方法</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/07/postfixoutbound-port-25-blocki.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.343</id>

    <published>2010-07-18T09:33:34Z</published>
    <updated>2010-07-18T10:56:10Z</updated>

    <summary> No route to host (port 25)の原因と対策 自宅サーバか...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
    <category term="postfix" label="postfix" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[<h4> No route to host (port 25)の原因と対策</h4>
自宅サーバから自分の携帯やらGmailやらにメール送信しようしたら、送れませんでした。<br />
Postfixのメールログを見るとこんな感じでした。

<pre><code>
Jul 18 18:16:41 centos postfix/smtp[3250]: connect to gmail-smtp-in.l.google.com[74.125.53.27]: Connection timed out (port 25)
Jul 18 18:16:52 centos postfix/smtp[3250]: connect to alt1.gmail-smtp-in.l.google.com[74.125.95.27]: No route to host (port 25)
Jul 18 18:17:22 centos postfix/smtp[3250]: connect to alt2.gmail-smtp-in.l.google.com[74.125.65.27]: Connection timed out (port 25)
Jul 18 18:17:36 centos postfix/smtp[3250]: connect to alt3.gmail-smtp-in.l.google.com[74.125.93.27]: No route to host (port 25)
Jul 18 18:17:47 centos postfix/smtp[3250]: connect to alt4.gmail-smtp-in.l.google.com[209.85.227.27]: No route to host (port 25)
Jul 18 18:17:47 centos postfix/smtp[3250]: 96E9D78834A: to=<********@gmail.com>, relay=none, 
delay=96, delays=0.07/0.01/96/0, dsn=4.4.1, status=deferred (
connect to alt4.gmail-smtp-in.l.google.com[209.85.227.27]: No route to host)
</code></pre>

調べたところ、どうやら「Outbound port 25 Blocking(OP25B)」というやつが原因のようでした。<br />
ISPが迷惑メール対策として25番ポートに制限をかけているそうです。

<h4>対策</h4>
<br/>
<h5>準備</h5>
契約しているISPのアカウント、パスワード、smtpサーバのアドレスを確認します。<br />
ここでは、ISPの契約情報が下記の通りになっていると仮定します。
<table border="1" >
<tr><td>メールアカウント</td><td style="text-align:left;"> hoge001</td></tr>
<tr><td>パスワード</td><td style="text-align:left;"> mypasswd</td></tr>
<tr><td>送信メールサーバ(smtp)</td><td  style="text-align:left;"> smtp.example.ne.jp</td></tr>
</table>
<br/>
<h5>main.cnf</h5>
main.cnfに下記を追記します。
<pre><code># OP25B対策の設定
relayhost = [smtp.example.ne.jp]:587
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/isppasswd
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter =
</code></pre>
<br/>
<h5>master.cnf</h5>
master.cnfで、#submission inet ..... あたりがコメントアウトされているので#を削除して有効にします。
<br/>

CentOS5.3の場合
<pre><code>submission inet n       -       n       -       -       smtpd
  -o smtpd_enforce_tls=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
</code></pre>
<br/>
Ubuntu9.04の場合
<pre><code>submission inet n       -       -       -       -       smtpd
  -o smtpd_enforce_tls=yes
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
</code></pre>
<br/>
<h5>パスワードファイルを作る</h5>
/etc/postfix/ の下に"isppasswd"というファイルを作成します。
<pre><code>vi /etc/postfix/isppasswd</code></pre>

<pre><code>smtp.example.ne.jp hoge001:mypasswd</code></pre>


postmapコマンドを実行します。
<pre><code>postmap /etc/postfix/isppasswd</code></pre>
<br/>
<h5>sasl関係のライブラリをインストール</h5>
Ubuntuの場合
<pre><code># apt-get install libsasl2-2 libsasl2-modules sasl2-bin</code></pre>

CentOSの場合
何もインストールしないで行けました。
<br/>
<h5>postfixを再起動</h5>
<pre><code># /etc/init.d/postfix reload</code></pre>


以上でメール送信できるようになりました。

<h4>参考</h4>
<a href="http://debiansrv.com/Outbound_Blocking">Outbound port 25 Blocking対応 | Debian LennyでLinuxサーバー構築:</a>]]>
        
    </content>
</entry>

<entry>
    <title>Call to undefined function imagecreate() </title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/07/ubuntu-php5gd.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.342</id>

    <published>2010-07-11T09:38:47Z</published>
    <updated>2010-07-11T09:45:47Z</updated>

    <summary>上記のエラーが出るのは、GDモジュールが入ってないのが原因です。 GDをインスト...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[<p>上記のエラーが出るのは、GDモジュールが入ってないのが原因です。</p>

<p>GDをインストールする方法　( Ubuntu + PHP5 )</p>

<pre><code>sudo apt-get install php5-gd
sudo /etc/init.d/apache2 restart     # apache再起動</code></pre>
]]>
        
    </content>
</entry>

<entry>
    <title>warning: incompatible implicit declaration of built-in function &apos;exit&apos;</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/07/warning-incompatible-implicit-.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.341</id>

    <published>2010-07-10T06:05:50Z</published>
    <updated>2010-07-10T06:13:14Z</updated>

    <summary>C言語で上記のようなエラーが出た場合の解決方法。 原因 ヘッダーファイル&quot;std...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="C言語" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[C言語で上記のようなエラーが出た場合の解決方法。

<h4>原因</h4>

ヘッダーファイル"stdlib.h"を読み込み忘れている 

<h4>対処法</h4>

ソースコードの先頭に、下記のように書きます。
<pre><code>#include &lt;stdlib.h&gt;</code></pre>
]]>
        
    </content>
</entry>

<entry>
    <title>Windows + PHP + Imagickをインストールする方法</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/07/windows-php-imagick.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.340</id>

    <published>2010-07-09T11:53:07Z</published>
    <updated>2010-07-12T01:21:36Z</updated>

    <summary>PHP 5.3.1や PHP 5.3.2の場合、何をどうやってもImagickを...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[<p>PHP 5.3.1や PHP 5.3.2の場合、何をどうやってもImagickをインストールすることができませんでした。</p>

<p>結局、PHPのバージョンを5.2.13にしたらうまく行きました。</p>

<h4>Windows + PHP5.2でImagickをインストールする方法</h4>

<p>・ImageMagickをダウンロード＆インストール</p>

<p>・PHP公式サイトから、PHP5.2の最新版をダウンロード<br />
(現時点ではphp-5.2.13-win32-installer.msi)</p>

<p>　<a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a></p>

<p>・下記サイトから、php_imagick_dyn-Q16.dllをダウンロード</p>

<p>　<a href="http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/">http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/</a></p>

<p>・php.exeと同じ場所にphp_imagick_dyn-Q16.dllを置く。</p>

<p>・php.iniに下記を追記</p>

<p>　extension=php_imagick_dyn-Q16.dll</p>]]>
        
    </content>
</entry>

<entry>
    <title>Movable Type 4.0から5.02にアップグレードしました。</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/06/movable-type-40502.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.339</id>

    <published>2010-06-13T16:21:06Z</published>
    <updated>2010-06-13T19:35:46Z</updated>

    <summary>2007年夏にMT4.0を導入してから、一度もアップグレートしていなかった（怖く...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="MovableType" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[<p>2007年夏にMT4.0を導入してから、一度もアップグレートしていなかった（怖くていじれなかった）のですが、ついにバージョン５(5.02)にアップグレードしました。</p>

<h4>バージョン４→５への移行について</h4>

<p>公式サイトの手順どおりにやったら、わりとすんなりアップグレードできました。</p>

<p><br />
<h4>バージョン５を使ってみての感想</h4></p>

<p>まだほんの少ししか触っていませんが、管理画面がすっきりして使い勝手がよくなった気がします。</p>

<p>バージョン４の場合だと、ログインしてからブログ記事を作成するまでに、下記のように５ステップ必要でした。</p>

<p>ログイン　→　ブログ一覧　→　目的のブログを選択　→　記事の新規作成</p>

<p>これがバージョン５だと、</p>

<p>ログイン　→　記事の新規作成</p>

<p>と２工程にまで減りました。</p>

<p>また、管理画面のレイアウトで、メニューバーが従来は画面上部にプルダウン式だったのが、３カラム方式の左サイドに変わっています。</p>

<p>噂ではバージョン３のスタイルに戻したそうですが、少し使いやすくなった気がします。</p>

<p>インストールしてすぐ感じたのは以上です。<br />
もっと使い込んだらいろいろ感想が出てくると思いますので、このブログで報告します。</p>]]>
        
    </content>
</entry>

<entry>
    <title>たった５行のコードでWebページ取得・解析をするJavaScriptプログラム</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/06/webjavascript.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.338</id>

    <published>2010-06-07T17:57:02Z</published>
    <updated>2010-06-07T23:35:43Z</updated>

    <summary>５行のコードで、Yahoo!のトピックス一覧を抽出する！使うのは「メモ帳」だけ！...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="JavaScript" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="jscript" label="JScript" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[<h4>５行のコードで、Yahoo!のトピックス一覧を抽出する！使うのは「メモ帳」だけ！</h4>
Windowsユーザのみなさん、社会人・学生のみなさん、こんにちわ。<br/>
プログラマではないあなたのために、プログラムの面白さを伝えるためにこの記事を書きました。<br />
<br />
これから、たった５行のコードでYahoo!のトピックス一覧を抽出してみます。<br />
このプログラムのすごいところは、何もインストールしなくてよいことです。<br />
Windowsとメモ帳だけあれば動きます。<br />
<br />
下記のコードをメモ帳に貼り付けて、デスクトップに保存してください。<br />
(IE6,7で動作確認済みです。たぶんIE8でも動きます。）<br />
<br />
ファイル名： yahoo.jse
<pre><code>
var IE = new ActiveXObject('InternetExplorer.Application');
IE.navigate('http://yahoo.co.jp');
while (IE.busy);
while (IE.document.readyState != "complete");
WSH.Echo(IE.document.getElementById('topicsfb').innerText);

</code></pre>
<br style="clear:both;" />
ファイル名が　" yahoo.jse.txt "　にならないように気をつけてくださいね<br />
<br />
<img src="http://dqn.sakusakutto.jp/2010/06/08/01-thumb-426x270.jpg" width="426" height="270" alt="jscript01.JPG" />
<br style="clear:both;" />
<br />
保存したら、ダブルクリックします。<br />
<br />
<img src="http://dqn.sakusakutto.jp/2010/06/08/02.jpg" width="147" height="121" alt="02.jpg" />
<br style="clear:both;" />
<br />
すると、、、ほら！！<br style="clear:both;" />
<br />
<img alt="03.jpg" src="http://dqn.sakusakutto.jp/2010/06/08/03.jpg" width="634" height="166" style="display: block; "/>
<br style="clear:both;" />
ね、すごいでしょ？<br />
<br />
<h4>応用例</h4>

<h5>株価を取得する</h5>
トヨタ自動車の株価をチェックしてみたりとか。<br />
<br />
<pre><code>
var IE = new ActiveXObject('InternetExplorer.Application');
IE.navigate('http://profile.yahoo.co.jp/fundamental/7203');
while (IE.busy);
while (IE.document.readyState != "complete");
WSH.Echo(IE.document.getElementById('left_col').innerText);

</code></pre>

<img alt="04.jpg" src="http://dqn.sakusakutto.jp/2010/06/08/04.jpg" width="176" height="226" /><br />
<br />
<h5>気象庁の天気予報を取得する</h5>
明日のデートにそなえたりとか。<br />
<br />
<pre><code>
var IE = new ActiveXObject('InternetExplorer.Application');
IE.navigate('http://tenki.jp/');
while (IE.busy);
while (IE.document.readyState != "complete");
WSH.Echo(IE.document.getElementById('descriptionEntries').innerText);

</code></pre>
<br />
<img alt="05.jpg" src="http://dqn.sakusakutto.jp/2010/06/08/05.jpg" width="640" height="118"  style="display: block;"/>
<br />
どうですか、簡単でしょう？<br />
<br />
<h4>まとめ</h4>
JavaScript(厳密に言うとJScript)で遊んでみました。<br />
Windowsには、このようにメモ帳だけでプログラムを実行できる素晴らしい環境があります。<br />
特別なソフトを入れずとも、すぐプログラムが書けるのです。<br />
<br />
これでプログラミングの楽しさを知っていただけたら幸いです。<br />
<br />
（くれぐれも悪用しないでくださいね！！）<br />]]>
        
    </content>
</entry>

<entry>
    <title>簡単！たった１行のコードでWebページを取得するPerlスクリプト</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/06/webperl.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.337</id>

    <published>2010-06-06T18:21:50Z</published>
    <updated>2010-06-06T18:53:10Z</updated>

    <summary>コマンド１発で、ヤフーのトップページを取得する！ Perlを使うと、たった１行の...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="lwp" label="LWP" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[<h4>コマンド１発で、ヤフーのトップページを取得する！</h4>
Perlを使うと、たった１行のコード（というかコマンド）でウェブページのHTMLを取得できます。<br />
<br />
しかも、LinuxでもWIndowsでも全く同じコマンドで動作します。<br />

<pre><code>
Linux系の場合
$ perl -MLWP::Simple -e  " print get 'http://yahoo.co.jp' "


Windowsの場合（コマンドプロンプトで下記を入力)
> perl -MLWP::Simple -e  " print get 'http://yahoo.co.jp' "

</code></pre>
<br />
<strong>実行結果</strong><br />
<pre><code>Wide character in print at -e line 1.
&lt;!DOCTYPE&nbsp;HTML&nbsp;PUBLIC&nbsp;&quot;-//W3C//DTD&nbsp;HTML&nbsp;4.01&nbsp;
Transitional//EN&quot;&nbsp;&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta&nbsp;http-equiv=&quot;content-type&quot;&nbsp;content=&quot;text/html;&nbsp;charset=utf-8&quot;&gt;
&lt;meta&nbsp;http-equiv=&quot;content-style-type&quot;&nbsp;content=&quot;text/css&quot;&gt;
&lt;meta&nbsp;http-equiv=&quot;content-script-type&quot;&nbsp;content=&quot;text/javascript&quot;&gt;
&lt;meta&nbsp;name=&quot;description&quot;&nbsp;content=&quot;日本最大級のポータルサイト。
検索、オークション、ニュース、メール、コミュニティ、ショッピング、など80以上のサービスを展開。
あなたの生活をより豊かにする「ライフ・エンジン」を目指していきます。&quot;&gt;
&lt;title&gt;Yahoo!&nbsp;JAPAN&lt;/title&gt;
&lt;base&nbsp;href=&quot;http://www.yahoo.co.jp/_ylh=X3oDMTB2OHNyYWxqBF9TAzIwNzkxODE5OTkEdGlkA
zEzBHRtcGwDdGFibGU-/&quot;&gt;
&lt;style&nbsp;type=&quot;text/css&quot;&gt;
(以下省略)
</code></pre>

<br />
取得したHTMLをファイルとして保存したい場合は、下記のようにします。<br />
こうすると、結果を画面に表示する代わりにファイルに保存できます。<br />
<br />
<pre><code>
perl -MLWP::Simple -e  " print get 'http://yahoo.co.jp'" > yahoo.html
</code></pre>

ちなみに">"記号のことを「リダイレクト」といいます。<br />
<br />
Perlって素晴らしい！！<br />
<br />
<br />
<br />
【補足１】<br />
LWP::Simpleモジュールが必要です。<br />
上記のget関数は、Perlの標準関数ではなくてLWP::Simpleというモジュールが提供する関数です。<br />
インストール方法は割愛しますが、よく使われるモジュールなのでレンタルサーバなどでは初めから入ってることが多いです。<br />
（Xreaにはインストール済みでした。）<br />
<br />
【補足２】<br />
出力結果の１行目に警告が出ちゃってますが、多めに見てあげてください。。。
]]>
        
    </content>
</entry>

<entry>
    <title>Smarty 半角数字を全角数字に変換するプラグイン</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/06/smarty.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.336</id>

    <published>2010-06-06T12:57:58Z</published>
    <updated>2010-06-06T13:02:23Z</updated>

    <summary> /**  * 半角数字→全角数字に置き換えるmodifier  *  * @s...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="PHP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="smarty" label="Smarty" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[<pre><code>
/**
 * 半角数字→全角数字に置き換えるmodifier
 *
 * @see
 * http://pentan.info/php/smarty/mod_hkana.html
 *
 */
function smarty_modifier_numeric_hantozen($string, $encoding = 'UTF-8')
{
    return mb_convert_kana($string, "N", $encoding);
}
</code></pre>

<h4>使い方</h4>
ファイル名を "modifier.numeric_hantozen.php" にして、Smartyのプラグインディレクトリに保存してください。<br />
<br />
テンプレート内で、下記のようにと書くと変換してくれます。
<br />
<pre><code>
{$number|numeric_hantozen}

</code></pre>

<h5>参考記事</h5>
<a href="http://pentan.info/php/smarty/mod_hkana.html">携帯表示用に文字を全角から半角にする - [Smarty] ぺんたん info</a>]]>
        
    </content>
</entry>

<entry>
    <title>[Perl] Ubuntu9.04にWeb::Scraperをインストールする方法</title>
    <link rel="alternate" type="text/html" href="http://dqn.sakusakutto.jp/2010/06/perl-ubuntu904webscraper.html" />
    <id>tag:dqn.sakusakutto.jp,2010://5.335</id>

    <published>2010-06-06T09:18:05Z</published>
    <updated>2010-06-06T09:19:37Z</updated>

    <summary>前回の記事で、XML::LibXMLのインストールが失敗してることまではわかりま...</summary>
    <author>
        <name>DQNEO</name>
        
    </author>
    
        <category term="Perl" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="webscraper" label="Web::Scraper" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="ja" xml:base="http://dqn.sakusakutto.jp/">
        <![CDATA[前回の記事で、XML::LibXMLのインストールが失敗してることまではわかりました。<br />
<br />
<pre><code>cpan[1]> install XML::LibXML
CPAN: Storable loaded ok (v2.18)
Going to read '/root/.cpan/Metadata'
  Database was generated on Sat, 05 Jun 2010 04:27:23 GMT
CPAN: YAML loaded ok (v0.70)
Going to read 86 yaml files from /root/.cpan/build/
CPAN: Time::HiRes loaded ok (v1.9711)
DONE
Restored the state of none (in 2.0500 secs)
Running install for module 'XML::LibXML'
Running make for P/PA/PAJAS/XML-LibXML-1.70.tar.gz
  Has already been unwrapped into directory /root/.cpan/build/XML-LibXML-1.70-IIX0Tb
  No 'Makefile' created
, won't make
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
</code></pre>
<br />
とりあえず解決できたので、以下にその方法を載せておきます。<br />
原因や仕組みはよくわかりません。すいません。。<br />
<br />
<pre><code>
# su -        # rootになる
# cd /root/.cpan/build/XML-LibXML-1.70-IIX0Tb
# perl Makefile.PL      # Makefile.PLを実行　→　エラーが出る
# apt-get install libxml2-dev       # ライブラリをインストール
# perl Makefile.PL       #  Makefile.PLを実行　→　またエラーが出る
# apt-get install libxml-libxml-perl      # ライブラリをインストール
# perl Makefile.PL       # 成功！！
# make
# make test
# make install
# update-perl-sax-parsers       # 一応。
# cpan

cpan>  install XML::libXML       # 成功！
cpan>  install Web::Scraper      # 成功！
</code></pre>
<br />
成功！！<br />
<br />
動作確認は次回の記事で。

]]>
        
    </content>
</entry>

</feed>
