#!/usr/local/bin/perl $body = '<body bgcolor=#000000 text=#ffffff>'; $dicfile = "dic.txt"; #ソートするファイル $dicfile1 = "dic1.txt"; #出力するファイル $uniq = `uniq $dicfile` || &error('コマンドエラー','uniqが使えないっす.'); @dic = split ("\n",$uniq); @dic = sort(@dic); print "Content-type: text/html\n\n"; print "<html><head><title>sort&uniq</title></head>\n"; print "$body<pre>\n"; open(QQ,">$dicfile1"); for(@dic){ print QQ "$_\n"; print "$_\n"; } # $num = @dic; print "\n$num\n"; print "end"; close(QQ); print "</pre></body></html>"; exit; sub error { print "Content-type: text/html\n\n"; print "<html><head><title>えら〜</title></head>\n"; print "$body<h1>$_[0]</h1><h3>$_[1]</h3></body></html>\n"; exit; }

written by 2代目怒羅絵悶