<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://wiki.sars.tw/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel>
        <title>Sars' History perl</title>
        <description></description>
        <link>https://wiki.sars.tw/</link>
        <lastBuildDate>Sun, 12 Apr 2026 00:09:04 +0800</lastBuildDate>
        <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
        <image>
            <url>https://wiki.sars.tw/lib/tpl/dokuwiki/images/favicon.ico</url>
            <title>Sars' History</title>
            <link>https://wiki.sars.tw/</link>
        </image>
        <item>
            <title>perl:document</title>
            <link>https://wiki.sars.tw/doku.php?id=perl:document&amp;rev=1242217622&amp;do=diff</link>
            <description>Perl

&lt;http://perl.hcchien.org/toc.html&gt;</description>
        <category>perl</category>
            <pubDate>Wed, 13 May 2009 20:27:02 +0800</pubDate>
        </item>
        <item>
            <title>perl:rename</title>
            <link>https://wiki.sars.tw/doku.php?id=perl:rename&amp;rev=1185714594&amp;do=diff</link>
            <description>批次修改檔名

將檔案名末端的 .ptt.htm 改成 .ppt


foreach my $file (glob &quot;*.ppt.htm&quot;) {
    my $newfile = $file;
    $newfile =~ s/\.htm//;
    if (-e $newfile) {
        warn &quot;wrong!!!\n&quot;;
    } elsif (rename $file, $newfile) {
    } else {
        warn &quot;failed!!!\n&quot;;
    }
}</description>
        <category>perl</category>
            <pubDate>Sun, 29 Jul 2007 21:09:54 +0800</pubDate>
        </item>
        <item>
            <title>perl:yahoo_dictionary</title>
            <link>https://wiki.sars.tw/doku.php?id=perl:yahoo_dictionary&amp;rev=1176576086&amp;do=diff</link>
            <description>yahoo 字典

參考：&lt;http://plog.longwin.com.tw/programming/2007/01/12/y_dictionary_script_2007&gt;

Perl 版本


#!/usr/bin/perl
# Yen-Ming Lee &lt;leeym@leeym.com&gt;
# 2007/01/09
use Encode qw(encode decode from_to);
use Term::ANSIColor qw(:constants);
use Data::Dumper;
use LWP::Simple;
use strict;

ydict(shift);

sub ydict
{
  my $p = shift;
  die if !$p;
  my $html = get(&quot;http://tw.dictionary.yahoo.com/search?p=$p&quot;);
  from_to($html, &quot;utf-8&quot;, &quot;big5&quot;) if $ENV{'LC_CTYPE'} =~ /Big5/;
  my $i = 0;
  $html =~ s/\r…</description>
        <category>perl</category>
            <pubDate>Sun, 15 Apr 2007 02:41:26 +0800</pubDate>
        </item>
    </channel>
</rss>
