持之以恒

导航

2014年1月19日 #

【转】perl目录文件操作--复制,移动,重命名

摘要: perl目录文件操作--复制,移动,重命名perl目录操作,创建目录句柄指向要操作的目录。 打开目录句柄使用 opendir ;opendir dirhandle,directory ;例:取某目录下文件的列表:opendir (e,'E:\娱乐\music\阿杜')|| die"can't open e: $!" ;@files=readdir e;closedir(e) ;for($index=0;$index<@files ;$index++){ print "@files[$index]\n" ;}#输出指定目录下的 阅读全文

posted @ 2014-01-19 23:47 beilei 阅读(572) 评论(0) 推荐(0) 编辑

【转】Perl Unicode全攻略

摘要: Perl Unicode全攻略耐心看完本文,相信你今后在unicode处理上不会再有什么问题。本文内容适用于perl 5.8及其以上版本。perl internal form在Perl看来, 字符串只有两种形式。 一种是octets, 即8位序列, 也就是我们通常说的字节数组. 另一种utf8编码的字符串, perl管它叫string。 也就是说: Perl只认识两种编码: Ascii(octets)和utf8(string)。utf8 flag那么perl如何确定一个字符串是octets还是utf8编码的字符串呢? perl可没有什么智能, 他完全是靠字符串上的utf8 flag。在perl 阅读全文

posted @ 2014-01-19 23:09 beilei 阅读(161) 评论(0) 推荐(0) 编辑