メイン

2007年05月02日

Perl のデバッグ

CGIでエラーをブラウザに表示するにはCGI::Carpモジュールを使う

use CGI::Carp qw(fatalsToBrowser);

この1行をいれておくだけ。
こんな風にエラーが表示されます。
Software error:
Can't locate XML/Agent.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.6/i386-linux-thread-multi /usr/lib/perl5/5.8.6 .) at test.pl line 7, line 846.
BEGIN failed--compilation aborted at test.pl line 7, line 846.

For help, please send mail to the webmaster (admin@heteml.jp), giving this error message and the time and date of the error.

2007年04月17日

Perl 全角ひらがなから全角カタカナへの変換

sub hiragana2katakana {
local($_) = @_;
s/\xa5\xa4/`/g;
s/\xa4([\xa1-\xfe])/\xa5$1/g;
s/`/\xa5\xa4/g;
$_;
}


$katakana = hiragana2katakana($hiragana);

2007年03月24日

Mac OSX でのCPAN

Testing handle creation speed...
9523 NullP sth/s perl 5.008006 darwin-thread-multi-2level (gcc 3.3 -Os) 0.000105s

test.pl done
/usr/bin/make test -- OK
Running make install
Manifying blib/man1/dbiproxy.1
Warning: You do not have permissions to install into /usr/local/man/man1 at /System/Library/Perl/5.8.6/ExtUtils/Install.pm line 114.
mkdir /usr/local/man/man3: Permission denied at /System/Library/Perl/5.8.6/ExtUtils/Install.pm line 112
make: *** [pure_site_install] Error 255
/usr/bin/make install -- NOT OK

一般のユーザーでインストールするとこんな風になるようです。

sudo cpan で行うとうまくいきます。

All tests successful, 1 test skipped.
Files=4, Tests=567, 23 wallclock secs ( 5.62 cusr + 12.00 csys = 17.62 CPU)
/usr/bin/make test -- OK
Running make install
Installing /System/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DB_File/DB_File.bundle
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /System/Library/Perl/5.8.6/darwin-thread-multi-2level/DB_File.pm
Installing /System/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DB_File/autosplit.ix
Installing /usr/share/man/man3/DB_File.3pm
Writing //System/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/DB_File/.packlist
Appending installation info to //System/Library/Perl/5.8.6/darwin-thread-multi-2level/perllocal.pod
/usr/bin/make install -- OK

2007年03月22日

Mac OSX Perl 5.8.8 インストール

ftp://ftp.cpan.org/pub/CPAN/src/

ここからperl-5.8.8.tar.gzをダウンロードします

tar xvzf perl-5.8.8.tar.gz
sudo chown -R $User:wheel perl-5.8.8
cd perl-5.8.8
./configure
make
sudo make install

/usr/local/bin/perlにインストールされるので現在のperlと置き換えます
/usr/bin/perl -v
/usr/local/bin/perl -v
mv /usr/bin/perl /usr/bin/perl_org
sudo mv /usr/bin/perl /usr/bin/perl_org
sudo ln -snf /usr/local/bin/perl /usr/bin/perl

perl -v
This is perl, v5.8.8 built for darwin-2level

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

2007年02月26日

SAJAX

AJAXをシンプルに使うライブラリがリリースされています。
05年末ごろにJavaのクラス内部のメソッドをJavaScriptで呼び出せるAPIがリリースされています。
PHPに限って言えばそんなことができるようです。
Sajax.phpを呼び出した後に関数を定義してやればJavascriptでコールできるようです。

詳しくはサンプルを参照
http://www.modernmethod.com/sajax/

2007年01月14日

Plagger 動作 Windows / Linux

windows環境でも成功しました
よくあるブログの記事をgmailに転送するやつ。
私の場合、ポイントはNet::SSLeyのコンパイルがうまくいっていない点でした。
OpenSSLを http://www.slproweb.com/products/Win32OpenSSL.html ここから持ってきたり
Linuxサーバーのほうでコンパイルしたのもをコピーしたりしながら
ようやくできました。

config.yaml はこのとおりです
global:
plugin_path:
- C:\Perl\site\lib\Plagger\Plugin
assets_path: C:\Perl\site\lib\Plagger\assets
timezone: Asia/Tokyo
log:
level: info
cache:
base: C:\plagger

plugins:
- module: Subscription::Config
config:
feed:
- http://blog.bulknews.net/mt/index.rdf

- module: Publish::Gmail
config:
mailto: 自分のGmailアドレス
mailfrom: 自分のGmailアドレス
mailroute:
via: smtp_tls
host: smtp.gmail.com:587
username: 自分のGmailアドレス
password: 自分のパスワード

これでGmailアカウントでログインしてメールを飛ばします

Linuxの場合はこんな感じ
global:
plugin_path:
- /usr/local/lib/perl5/site_perl/5.8.8/Plagger/Plugin
assets_path: /usr/local/lib/perl5/5.8.8/Plagger/assets
timezone: Asia/Tokyo
log:
level: info
cache:
base: C:\plagger

plugins:
- module: Subscription::Config
config:
feed:
- http://blog.bulknews.net/mt/index.rdf

- module: Publish::Gmail
config:
mailto: 自分のGmailアドレス
mailfrom: 自分のGmailアドレス
mailroute:
via: smtp_tls
host: smtp.gmail.com:587
username: 自分のGmailアドレス
password:  パスワード

2007年01月13日

XML::LibXML インストール windows

windows の場合、libxml/parser.h がないというエラーでコンパイルできないことがあります。

そのような場合 http://www.zlatkovic.com/pub/libxml/ ここから
iconv-1.9.2.win32.zip libxml2-2.6.27.win32.zip ダウンロード&展開後、
C開発環境bin, include, lib のそれぞれの場所に解凍後ディレクトリの該当する部分をすべてコピーします。

私の場合、このディレクトリのbin, include, lib のコピーしました。
C:\MicrosoftVisualStudio\VC98

cpan -i XML::SAX
cpan -i XML::LibXML::Common
cpan -i XML::Libxml

nmake install -- OK が出れば成功です

2007年01月11日

XML::LibXML インストール Linux

RH9にインストールできなかったときのメモ

XML::LibXML に適したlibxml2がないというエラーが出ていました。
このときのバージョンは 2.6.11 でした。

http://xmlsoft.org/ ここから libxml2-2.6.26.tar.gz をダウンロードします
tar xvzf libxml2-2.6.26.tar.gz
cd libxml2-2.6.26
./configure --prefix=/usr
make
make install

rpm では依存性のエラーがでましたのでソースからコンパイルしました

cpan -fi XML::SAM
cpan -fi XML::LibXML::Common
cpan -fi XML::LibXML

All tests successful, 44 subtests skipped.
Files=32, Tests=1766, 3 wallclock secs ( 3.03 cusr + 0.25 csys = 3.28 CPU)
/usr/bin/make test -- OK
Running make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /usr/local/lib/perl5/site_perl/5.8.8/i686-linux/auto/XML/LibXML/.packlist
Appending installation info to /usr/local/lib/perl5/5.8.8/i686-linux/perllocal.pod
/usr/bin/make install -- OK

できた!


 

2007年01月10日

Plagger インストールその後

Windows の場合
C:\Perl\cpan\build\Plagger-0.7.17\ あたりにある

assets をフォルダごとPerlのライブラリパスが通っているところに配置しないとだめっぽいです

私はこのディレクトリの下にコピーしました
C:\Perl\lib\Plagger

XML::Parser のコンパイル

cpan -fi XML::Parser で
最後に expat.h がないためにインストールできないメッセージがでたので

APACHE_HOME/include 以下の expat.h をPathの通っているところにコピーしてコンパイル

2007年01月09日

Plagger 再インストール Windows

いくつかのCPANモジュールでWindowsにCコンパイル環境がなかったため
エラーになっておりました
そのため マイクロソフト C++ Visual Studio Express Editions をインストールしました。
こちらから無料でダウンロード&インストールできます。
またユーザー登録をすれば30日以上使えます。
http://www.microsoft.com/japan/msdn/vstudio/express/visualc/
 *SQLサーバーは入れておりません 最小限のインストールです

インストールが終わったら "cl.exe"、"nmake.exe"のあるディレクトリまでPathを通します。

C:\MicrosoftVisualStudio8にインストールした場合

Path に追加 : C:\MicrosoftVisualStudio8\VC\bin;C:\MicrosoftVisualStudio8\Common7\IDE;
include に追加 : C:\MicrosoftVisualStudio8\VC\lib
lib に追加 : C:\MicrosoftVisualStudio8\VC\lib;C:\MicrosoftVisualStudio8\SDK\v2.0\Lib
 
その後、Microsoft Platform SDK もインストールします
http://www.microsoft.com/japan/msdn/vstudio/express/visualc/usingpsdk/
サイト上の解説のほかに
Include に追加 : C:\Program Files\Microsoft Platform SDK\Include\crt;C:\Program Files\Microsoft Platform SDK\Bin\win64;
 *sys/types.h , MSVCR80.dll がみつからないエラーを防ぎます
http://www.microsoft.com/japan/msdn/netframework/downloads/default.aspx

cpan > install Bundle::CPAN

これで -fi ( force install ) が使えるようになします

cpan -fi Plagger


しかしこれでもCコンパイル環境がうまく動きませんでしたので
ファイル交換ツールでゲットしたVisual C++ をインストールしています。

インストール後、環境変数Pathに
C:\VC98\Bin;C:\VC98\Lib;C:\VC98\Include を追加しています。

2007年01月03日

Plagger インストール windows

話題のPlaggerをインストールしてみました
単純にこんな感じw

Active Perlインストール済み端末でプロンプトを立ち上げる

C:\>ppm
ppm> rep add tcool http://ppm.tcool.org/server/ppmserver.cgi?urn:PPMServer

と打ち込むとこんな風に表示される

[1] ActiveState Package Repository
[2] tcool

そのあとに
ppm> search Plagger と打ち込むと

Searching in Active Repositories
1. Plagger [0.7.9] Pluggable RSS/Atom Aggregator
2. Plagger [0.7.9] Pluggable RSS/Atom Aggregator

こんな風に表示されます
その後に
ppm> install Plagger

とやれば1時間ぐらいでインストールされます

Successfully installed Plagger version 0.7.17 in ActivePerl 5.8.8

うまくいかないときは
Bundle::CPANをインストールしてみましょう。
もしくは
ppm> force install Plagger

2006年11月24日

フリーCGI修正

メール送信系ではsendmail へのパスを修正しないといけない場合が多い

#$SendmailCmnd = '/usr/lib/sendmail -n -t';
#$SendmailCmnd = '/usr/sbin/sendmail -n -t';
$SendmailCmnd = '/usr/sbin/sendmail -t -i';

こんな順番で修正

2006年11月21日

Plagger インストール

Windows の場合
 ppm install Plagger 又は CPAN install Plagger

Linux の場合
 perl -MCPAN -e 'Plagger'


-----------------------------------------
__ ___
(_ _|_ ._ ._ | o ._ _ _
__) |_ | |_) | | | | | (/_
|
-----------------------------------------

2006年10月10日

DB定義書出力プログラム

Perlモジュールを使ってエクセルファイルを作ります
ソースはこんな感じ。
設定を変えればPostgreSQL, MySQL 両方で使えます

#!C:\Perl\bin\perl
#!/usr/local/bin/perl

use strict;
use DBI;
use Jcode;
use Spreadsheet::WriteExcel;
use DBIx::DBSchema;

#設定
my $DSN = 'dbi:mysql:DB名:サーバー名';
my $DB_USER = 'ユーザー名';
my $DB_PASSWD = 'パスワード';
my $XLS_FILE = '出力ファイル名';

my $dbh = DBI->connect($DSN, $DB_USER, $DB_PASSWD) or die $DBI::errstr;
my $xls = Spreadsheet::WriteExcel->new($XLS_FILE);
my $schema = new_native DBIx::DBSchema $dbh;

for my $table ($schema->tables()) {
my $work = $xls->addworksheet("$table");

$work->write(0, 0, 'INDEXES');
my $index_ref = $dbh->selectall_arrayref("SHOW INDEX FROM $table");
write_worksheet($work, $index_ref, 1);

$work->write(3 + $#{$index_ref}, 0, 'COLUMNS');
my $column_ref = $dbh->selectall_arrayref("DESCRIBE $table");
write_worksheet($work, $column_ref, 4 + $#{$index_ref});
}

$dbh->disconnect;


sub write_worksheet {
my($work, $ref, $offset) = @_;
for my $row (0 .. $#{$ref}) {
for my $col (0 .. $#{$ref->[$row]}) {
$work->write($row + $offset, $col, $ref->[$row]->[$col]);
}
}
}

2006年09月27日

ActivePerl での DBD::mysql インストール

Windows XPでのお話

>cpan
>install DBI
>install DBD::mysql

ここでなせがエラーが出て先に進まなくなった。
なのでここから DBD-mysql-3.0002.zipをダウンロードしてインストールすることに
http://ppm.activestate.com/PPMPackages/zips/8xx-builds-only/Windows/

ppm install C:\download\DBD-mysql-3.0002\DBD-mysql.ppd

できたっぽい

2006年09月11日

MTインストール Image::Magick

某社の専用サーバーにMT 3.2 を入れようとしたところ
Image::Magick がないといわれてCPANでのインストールもアーカイブからのビルドも失敗したので
ImageMagick のインストールから行いました。

[root@www ImageMagick-6.1.8]# make
cd . && /bin/sh /usr/local/src/ImageMagick-6.1.8/missing --run autoconf
configure.ac:15: error: Autoconf version 2.59 or higher is required
configure.ac:15: the top level
autom4te: /usr/bin/m4 failed with exit status: 1
make: *** [configure] エラー 1

こんな風になってしまうのでautoconfのインストールから行います
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
tar xvzf autoconf-2.60.tar.gz
cd autoconf-2.60
./configure --prefix=/usr
make
make check
make install

wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar xvzf jpegsrc.v6b.tar.gz
./configure
make
make install

unzip ImageMagick-6.1.8-7.zip
cd ImageMagick-6.1.8
./configure
make
make install

tar xvzf PerlMagick-6.24.tar.gz
cd PerlMagick-6.24
perl Makefile.PL
ls
make
make install

2006年09月08日

Catalyst インストール WindowsXP

perl 5.8.8 の下で実行

プロンプトを立ち上げて
ppm
ppm > repository add Theoryx5 http://theoryx5.uwinnipeg.ca/ppms/
ppm > install Task-Catalyst
ppm > search Catalyst::Model::DBIC
ppm > install 1
ppm > install DBD::SQLite2
ppm > install Data-Uniqid
ppm > install Catalyst::Plugin::Prototype
ppm > install Catalyst::Plugin::Session
ppm > quit

2006年09月03日

CPAN ダウンロード先 変更

Config.pmに書かれています
find / -name Config.pm
vi /usr/local/lib/perl5/5.8.8/CPAN/Config.pm  たとえばこういうところ

'urllist' => [q[ftp://ftp.dti.ad.jp/pub/lang/CPAN/]],

ここ

ダウンロードがうまくいかないときはここのURLを書き換えます

Catalyst インストール Linux

Perl 5.8.8 インストール後、
perl -MCPAN -e 'install Module::Find'
perl -MCPAN -e 'install Path::Class'

perl -MCPAN -e 'install Task::Catalyst'

すべてデフォルトで

プラグインインストールで止まる場所があれば 個別でインストールする

*iptables は止めてインストールしたほうが早いです


終わったら必要に応じてプラグインをインストール
perl -MCPAN -e shell

install Catalyst::Helper
install DBI::DBD
install DBD::mysql
install DBIx::Class::Schema::Loader
install Bundle::LWP
install Catalyst::Helper::Model::DBIC::Schema
install Catalyst::Helper::View::TT
install Catalyst::Model::DBIC::Schema
install Catalyst::Plugin::Charsets::Japanese
install Catalyst::Plugin::FillInForm
install Catalyst::Plugin::Prototype

2006年09月02日

perl 5.8.8 インストール

Catalystをインストールしていると ここで止まった

CPAN.pm: Going to build S/SR/SRI/Catalyst-Plugin-HTML-Widget-1.1.tar.gz

*** Module::AutoInstall version 1.01
*** Checking for dependencies...
[Core Features]
- Catalyst ...missing. (would need 5.5)
- HTML::Widget ...missing.

試しに単体でCatalyst-Plugin-HTML-Widget-1.1.tar.gzを持ってきて
perl Make.pl したらどうもPerlのバージョンが5.8以上でないとだめっぽい

そこでperl 5.8.8 をインストールすることにした
http://www.perl.com/download.csp#stable ここからstable.tar.gz をダウンロード
tar xvzf stable.tar.gz
cd perl-5.8.8
すべてデフォルトでインストール
sh Configure -Dprefix=/usr/local/perl -de && nice -19 make && make test
make install

これでOK
/usr/local/bin/perl -v で確認
現在のものとパスを入れ替える
mv /usr/bin/perl /usr/bin/perl_org
ln -s /usr/local/bin/perl /usr/bin/perl

/etc/profile.d/perl5.8.sh を作成

vi /etc/profile.d/perl5.8.sh
#!/bin/sh
PERL_PATH=/usr/local/bin/perl
if [ ! -d "$PERL_PATH" ] ;then
export PERL5LIB=$PERL_PATH/lib
export PATH=$PERL_PATH/bin:$PATH
fi

ログインしなおして perl -v で確認

2006年08月28日

Perlによるメール送信

Javaみたいに使えるメール送信pmを組んでみました
使う場合はこんな風に

use Function::mail;

Function::mail::setSubject("題名");
Function::mail::setBody("本文");
Function::mail::setFromAddress("aaa@aaa.co.jp");
Function::mail::setToAddress("bbb@bbb.co.jp");
Function::mail::send();

pm は続き

続きを読む "Perlによるメール送信" »

2006年08月08日

Perlでのページ転送

print "Location: http://" . "転送したいURL" ."\n\n";
exit;

改行とexitをわすれずに

2006年08月03日

Perl でのPOST, GET変数取得

リクエストの種別を判定して下記のようにすれば
GETでもPOSTでも同じように取得できるっぽいです

if($ENV{'REQUEST_METHOD'} eq "GET"){

        $buffer = $ENV{'QUERY_STRING'} . '&';
        @pairs = split(/&/,$buffer);

}elsif ($ENV{'REQUEST_METHOD'} eq "POST"){

        $length = $ENV{'CONTENT_LENGTH'};
        read(STDIN, $buffer, $length);
        @pairs = split(/&/,$buffer);

}

        foreach $pair (@pairs){
                ($name,$value) = split(/=/, $pair);
                $value =~ tr/+/ /;
                $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
                $param_value{$name} = $value;
        }


$param_value{'変数名'} で value を取得

2006年07月28日

PerlでのRSS読込

XML::RSS と LWP::Simple を使えばすごく簡単にできます

#!C:\Perl\bin\perl
#!/usr/bin/perl
use strict;
use Jcode;
use Encode;
use LWP::Simple;
use XML::RSS;

my $rss = new XML::RSS;
my $url = "http://www.nikkeibp.co.jp/index.rdf";

my $dat = get($url);

$rss->parse($dat);

my $channel = $rss->{'channel'};


print "Content-type: text/plain; charset=UTF-8\n\n";

print $channel->{'title'};
print "
";
print "
";

foreach my $item( @{$rss->items}){

print $item->{'title'};
print "
";
print $item->{'link'};
print "
";

if( $item->{'description'} ){
print $item->{'description'};
print "
";
print "
";
}
}

exit;

2006年07月24日

Perlでの全角チェック

EUCの場合

sub check(){
if ($_[0] =~ /[\x80-\xFF]/) {
#全角
return "全角";
}
}

文字列に全角文字が含まれているかチェック

2006年07月14日

サブルーチン作成例

サブルーチンを作ってみた

## YYYY-MM-DD hh:mm:ss を返す
sub getNowDateTime{
    my ($sec,$min,$hour,$mday,$mon,$year,$wno) = localtime(time);
    return sprintf("%04d-%02d-%02d %02d:%02d:%02d",$year+1900,$mon+1,$mday,$hour,$min,$sec);
}

ついでにもうひとつ
#ランダムな文字列を返す
sub getRandStr {
    #文字数の指定
    my $value = shift;
    my @chara = qw(a b c d e f g h i j k l m n o p q r s t u v w z y x z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z );
    my $str;
       if( $value eq "" ){
            $str.=$chara[int(rand($#chara+1))] for ( 1..16 );
       }else{
            $str.=$chara[int(rand($#chara+1))] for ( 1..$value );
       }
       return $str;
}

Perl 日本語での配列

my @list = ("自民党", "民主党" ,"公明党" ,"共産党" ,"社民党");
↑これより

my @list = qw(自民党 民主党 公明党 共産党 社民党);
↑こんな風にしたほうがいいです

print $ist[$i]; のときにちゃんと値が取得できます hashXXXXにならない

2006年07月12日

Windows上でのApache + Perl 設定

ActivePerl をダウンロード
http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl

Windows      MSI     

ダウンロード後、ダブルクリックしてインストール
デフォルトではC:\Perlにインストールされるので
C:\Perl\bin をコマンドパスに追加する

Apache httpd.conf 修正
Options Indexes FollowSymLinks MultiViews ExecCGI Includes
*MultiViews と ExecCGI と Includes を追加します。

AddHandler cgi-script .cgi .pl
AddHandler send-as-is asis
AddHandler imap-file map
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddType text/html .html (記述追加)
AddOutputFilter INCLUDES .html (記述追加)

Windows Perl ppm

Windows Perl実行環境へのDBIモジュールの追加
ppmコマンドを使います

Dosプロンプトでppmと打ち込むと
C:\Perl>ppm
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState SRL. All Rights Reserved.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

このあとに
ppm> install DBI
====================
Install 'DBI' version 1.50 in ActivePerl 5.8.8.817
====================
Downloaded 513616 bytes.
Extracting 69/69: blib/arch/auto/DBI/Driver_xst.h
Installing C:\Perl\site\lib\auto\DBI\dbd_xsh.h
Installing C:\Perl\site\lib\auto\DBI\DBI.bs
Installing C:\Perl\site\lib\auto\DBI\DBI.dll
Installing C:\Perl\site\lib\auto\DBI\DBI.exp
Installing C:\Perl\site\lib\auto\DBI\DBI.lib
Installing C:\Perl\site\lib\auto\DBI\dbipport.h
Installing C:\Perl\site\lib\auto\DBI\dbivport.h
Installing C:\Perl\site\lib\auto\DBI\DBIXS.h
Installing C:\Perl\site\lib\auto\DBI\dbi_sql.h
Installing C:\Perl\site\lib\auto\DBI\Driver.xst
Installing C:\Perl\site\lib\auto\DBI\Driver_xst.h
Installing C:\Perl\html\bin\dbiprof.html
Installing C:\Perl\html\bin\dbiproxy.html
Installing C:\Perl\html\site\lib\DBI.html
Installing C:\Perl\html\site\lib\Bundle\DBI.html
Installing C:\Perl\html\site\lib\DBD\DBM.html
Installing C:\Perl\html\site\lib\DBD\File.html
Installing C:\Perl\html\site\lib\DBD\Proxy.html
Installing C:\Perl\html\site\lib\DBD\Sponge.html
Installing C:\Perl\html\site\lib\DBI\Changes.html
Installing C:\Perl\html\site\lib\DBI\DBD.html
Installing C:\Perl\html\site\lib\DBI\FAQ.html
Installing C:\Perl\html\site\lib\DBI\Profile.html
Installing C:\Perl\html\site\lib\DBI\ProfileData.html
Installing C:\Perl\html\site\lib\DBI\ProfileDumper.html
Installing C:\Perl\html\site\lib\DBI\ProxyServer.html
Installing C:\Perl\html\site\lib\DBI\PurePerl.html
Installing C:\Perl\html\site\lib\DBI\W32ODBC.html
Installing C:\Perl\html\site\lib\DBI\Const\GetInfoReturn.html
Installing C:\Perl\html\site\lib\DBI\Const\GetInfoType.html
Installing C:\Perl\html\site\lib\DBI\Const\GetInfo\ANSI.html
Installing C:\Perl\html\site\lib\DBI\Const\GetInfo\ODBC.html
Installing C:\Perl\html\site\lib\DBI\DBD\Metadata.html
Installing C:\Perl\html\site\lib\DBI\ProfileDumper\Apache.html
Installing C:\Perl\html\site\lib\DBI\SQL\Nano.html
Installing C:\Perl\html\site\lib\Win32\DBIODBC.html
Files found in blib\arch: installing files in blib\lib into architecture depende
nt library tree
Installing C:\Perl\site\lib\DBI.pm
Installing C:\Perl\site\lib\Bundle\DBI.pm
Installing C:\Perl\site\lib\DBD\DBM.pm
Installing C:\Perl\site\lib\DBD\ExampleP.pm
Installing C:\Perl\site\lib\DBD\File.pm
Installing C:\Perl\site\lib\DBD\NullP.pm
Installing C:\Perl\site\lib\DBD\Proxy.pm
Installing C:\Perl\site\lib\DBD\Sponge.pm
Installing C:\Perl\site\lib\DBI\Changes.pm
Installing C:\Perl\site\lib\DBI\DBD.pm
Installing C:\Perl\site\lib\DBI\FAQ.pm
Installing C:\Perl\site\lib\DBI\Profile.pm
Installing C:\Perl\site\lib\DBI\ProfileData.pm
Installing C:\Perl\site\lib\DBI\ProfileDumper.pm
Installing C:\Perl\site\lib\DBI\ProxyServer.pm
Installing C:\Perl\site\lib\DBI\PurePerl.pm
Installing C:\Perl\site\lib\DBI\W32ODBC.pm
Installing C:\Perl\site\lib\DBI\Const\GetInfoReturn.pm
Installing C:\Perl\site\lib\DBI\Const\GetInfoType.pm
Installing C:\Perl\site\lib\DBI\Const\GetInfo\ANSI.pm
Installing C:\Perl\site\lib\DBI\Const\GetInfo\ODBC.pm
Installing C:\Perl\site\lib\DBI\DBD\Metadata.pm
Installing C:\Perl\site\lib\DBI\ProfileDumper\Apache.pm
Installing C:\Perl\site\lib\DBI\SQL\Nano.pm
Installing C:\Perl\site\lib\Win32\DBIODBC.pm
Installing C:\Perl\bin\dbiprof
Installing C:\Perl\bin\dbiprof.bat
Installing C:\Perl\bin\dbiproxy
Installing C:\Perl\bin\dbiproxy.bat
Successfully installed DBI version 1.50 in ActivePerl 5.8.8.817

同じようにして
install DB_Fiel
install DBD-MySQL
install DBD-SQLite

2006年06月25日

WEB+DB PRESS vol.33




WEB+DB PRESS Vol.33

エンジニアの価値が決まる「構造化プログラミング」についての特集号です!
それとは別にライブドアのシステム構築の詳細な解説記事もあります。
実際に稼動している大規模システムの構築・運営ノウハウが公開されるなんてまずないですよ!

これを機にぜひ読んでみましょう。

WEB+DB PRESS Vol.33

2006年05月18日

Can't locate DB_File.pm in @INC

Movable Type をインストールすると・・・
# mt.cgi
Content-Type: text/html

Got an error: Unsupported driver MT::ObjectDriver::DBM: Can't locate DB_File.pm in @INC (@INC contains: ./extlib ./lib /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at lib/MT/ObjectDriver/DBM.pm line 9.
BEGIN failed--compilation aborted at lib/MT/ObjectDriver/DBM.pm line 9.
Compilation failed in require at (eval 3) line 1.
BEGIN failed--compilation aborted at (eval 3) line 1.

DB_File.pmが入っていないみたいだ
しかしこれはコマンドラインからインストールできる

perl -MCPAN -e shell
We have to reconfigure CPAN.pm due to following uninitialized parameters:

cpan_home, keep_source_where, build_dir, build_cache, scan_cache, index_expire, gzip, tar, unzip, make, pager, makepl_arg, make_arg, make_install_arg, urllist, inhibit_startup_message, ftp_proxy, http_proxy, no_proxy, prerequisites_policy, cache_metadata

/usr/lib/perl5/5.8.0/CPAN/Config.pm initialized.

続きを読む "Can't locate DB_File.pm in @INC " »