<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hexe19 &#187; Perl</title>
	<atom:link href="http://hexe19.net/category/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://hexe19.net</link>
	<description>*scratch*</description>
	<lastBuildDate>Sat, 16 May 2009 03:54:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQLite : disk I/O error(10) at dbdimp.c line 403</title>
		<link>http://hexe19.net/2008/04/21/42/sqlite-disk-io-error10-at-dbdimpc-line-403/</link>
		<comments>http://hexe19.net/2008/04/21/42/sqlite-disk-io-error10-at-dbdimpc-line-403/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 11:43:48 +0000</pubDate>
		<dc:creator>you</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Perl Database]]></category>

		<guid isPermaLink="false">http://hexe19.net/?p=42</guid>
		<description><![CDATA[ひさしぶりに、 SQLite を触ってみたら変なエラーが出たのでメモ。
環境
Windows XP SP2
FedoraCore7 on coLinux
SQLite 3.4.2

perl から sqlite を操作しても、 sqlite3 のコンソールから直接操作しても、cofs 上の database ファイルは扱えなかった。
※ファイルの作成はできるけど、 CREATE DATABASE とかの操作をすると
disk I/O error(10) at dbdimp.c line 403
解決策は、データベースを保存する場所を、cofs じゃない場所にしただけ。
tmpfs 上、ext3 上にデータベースを作成した場合はＯＫだった。
#!/bin/perl

use strict;
use warnings;
use DBI;

my $dbname;

$dbname = 'test.db'; # OK:ext*,tmpfs NG:cofs
unlink($dbname) if (-e $dbname); # テストだから毎回新規作成したい

unless (-e $dbname) {
    my ($dbh, $sql, $rc);

    [...]]]></description>
			<content:encoded><![CDATA[<p>ひさしぶりに、 SQLite を触ってみたら変なエラーが出たのでメモ。</p>
<ul>環境</p>
<li>Windows XP SP2</li>
<li>FedoraCore7 on coLinux</li>
<li>SQLite 3.4.2</li>
</ul>
<p>perl から sqlite を操作しても、 sqlite3 のコンソールから直接操作しても、cofs 上の database ファイルは扱えなかった。<br />
※ファイルの作成はできるけど、 CREATE DATABASE とかの操作をすると<br />
<code>disk I/O error(10) at dbdimp.c line 403</code></p>
<p>解決策は、データベースを保存する場所を、cofs じゃない場所にしただけ。<br />
tmpfs 上、ext3 上にデータベースを作成した場合はＯＫだった。</p>
<pre class="code">#!/bin/perl

use strict;
use warnings;
use DBI;

my $dbname;

$dbname = 'test.db'; # OK:ext*,tmpfs NG:cofs
unlink($dbname) if (-e $dbname); # テストだから毎回新規作成したい

unless (-e $dbname) {
    my ($dbh, $sql, $rc);

    $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {PrintError=>0});
    die "Error: $DBI::errstr\n" unless ($dbh);

    # cofs の時は CREATE のタイミングで↓のエラーが発生する
    # disk I/O error(10) at dbdimp.c line 403
    $sql = "CREATE TABLE users (id integer primary key, name varchar(32), age integer)";
    $rc = $dbh->do($sql);
    print "$DBI::errstr\n" unless ($rc);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://hexe19.net/2008/04/21/42/sqlite-disk-io-error10-at-dbdimpc-line-403/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSH &#8211; Perl</title>
		<link>http://hexe19.net/2008/03/02/6/wsh-perl/</link>
		<comments>http://hexe19.net/2008/03/02/6/wsh-perl/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 18:11:37 +0000</pubDate>
		<dc:creator>you</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[WSH]]></category>

		<guid isPermaLink="false">http://hexe19.net/wp/2008/03/02/6/</guid>
		<description><![CDATA[WSH で Perl を使えるようにできるらしい。
デフォルトはで、WSH には VBScript と JavaScript が使える。
WSH で Perl を使えるようにするには、ActivePerl をインストールすればいい。
そうすると、 pls という拡張子のファイルが WSH(Perl) のファイルと認識されてダブルクリックで実行できるようになる。
hello.pls
#!/bin/perl -w

our $WScript = $WScript;

use strict;
use warnings;

$WScript->Echo("Hello World!");


１行目のshebangは無くていい。
use strict; を使いたい場合は、use strict; よりも前の行で、our $WScript = $WScript; としないと変数が宣言されてないといわれてエラー。
実行するにはダブルクリック。

]]></description>
			<content:encoded><![CDATA[<p><a href='http://hexe19.net/2008/03/02/6/activeperl-logo/' rel='attachment wp-att-14' title='ActivePerl Logo' class="entry-image"><img src='http://hexe19.net/wp/wp-content/uploads/2008/03/activeperl_logo.gif' alt='ActivePerl Logo' /></a>WSH で Perl を使えるようにできるらしい。</p>
<p>デフォルトはで、WSH には VBScript と JavaScript が使える。</p>
<p>WSH で Perl を使えるようにするには、<a href="http://www.activestate.com/downloads/" target="_blank">ActivePerl</a> をインストールすればいい。</p>
<p>そうすると、 pls という拡張子のファイルが WSH(Perl) のファイルと認識されてダブルクリックで実行できるようになる。</p>
<p>hello.pls</p>
<pre class="code">#!/bin/perl -w

our $WScript = $WScript;

use strict;
use warnings;

$WScript->Echo("Hello World!");
</pre>
<ul>
<li>１行目のshebangは無くていい。</li>
<li>use strict; を使いたい場合は、use strict; よりも前の行で、our $WScript = $WScript; としないと変数が宣言されてないといわれてエラー。</li>
<li>実行するにはダブルクリック。</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://hexe19.net/2008/03/02/6/wsh-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
