![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Perl
坏脾气的猪
ubuntu 64bit 10.4
展开
-
perl正则表达式
perl正则表达式一、简介二、匹配操作符三、模式中的特殊字符1、字符2、字符 []和[^]3、字符 +,*和?4、转义字符5、匹配任意字母或数字6、锚模式7、模式中的变量替换8、字符范围转义前缀9、匹配任意字符10、匹配指定数目的字符11、指定选项12、模式的部分重用13、转义和特定字符的执行次序14、指定模式定界转载 2012-10-17 12:40:20 · 650 阅读 · 0 评论 -
PERL - LWP::SIMPLE 使用
http://zhidao.baidu.com/question/530489692.html http://blog.chinaunix.net/uid/17135777/cid-1400-list-1.html原创 2013-04-02 14:54:56 · 1054 阅读 · 0 评论 -
perl写入文件时中文乱码终极解决方案
perl写入文件时中文乱码终极解决方案在用perl写爬虫时,网页内容如果是英文可以正常写入文件,一旦网页中包含中文,文件是全部是乱码。可以网页的meta信息明明写着charset='utf8',并且我把网页内容直接输出到STDOUT也可以正常显示。尝试了很多方法都不行:open文件时指定utf8编码使用Encode::_to_utf8调用系统命令enca或iconv转码使用Un转载 2013-04-02 14:31:16 · 1714 阅读 · 0 评论 -
perl把Excel一列复制
#!perl -wuse Win32::OLE qw(in with);my $file = "C:/Users/Administrator/Desktop/input.xls";my $fileOut = "C:/Users/Administrator/Desktop/output.xls";my $sheet = 1;#第几个页my $Row = 3;#你要取出的列原创 2013-02-28 14:27:31 · 1230 阅读 · 0 评论 -
Perl GUI (未完待续)
use Win32::GUI; use Win32::GUI qw(CW_USEDEFAULT); use Win32::GUI::DIBitmap; use Win32::GUI::DropFiles; my $size = 20; $W = new Win32::GUI::Window ( -title => "原创 2012-11-19 10:32:00 · 1129 阅读 · 0 评论 -
perl连接SQLite
需要安装DBD::SQLite模块[root@localhost ~]# cat create_db.pl #!/usr/bin/perl -wuse strict;use DBI;my $db_file="data.db";#建立连接my $dbh = DBI->connect("dbi:SQLite:dbname=$db_file","","");转载 2012-11-29 12:20:57 · 1178 阅读 · 0 评论 -
收藏个perl程序
http://zhidao.baidu.com/question/497767826.html?push=cookie原创 2012-11-14 23:30:21 · 436 阅读 · 0 评论 -
perl分组捕获
问题如下 :http://zhidao.baidu.com/question/501928970.html?push=keyword 解决如下:#! /usr/bin/perl -wuse strict;my $string = "abc r=3 def r=3 test r=3 over";print $string , "\n";$string =~ s原创 2012-11-27 15:49:00 · 2223 阅读 · 0 评论 -
第一个perl程序
http://bbs.csdn.net/topics/390272012 帮完成了这个问题,收藏下use strict;use File::Find;use Getopt::Std;my @allcsvfile;my @targetfile;if($#ARGV == -1 ) { print "使用格式如下:perl list.pl 路径 关键字 >原创 2012-11-09 14:30:31 · 477 阅读 · 0 评论 -
perl基础-9 (Perl编程24学时教程)
#!usr/bin/perl -w$string = "one fish, two fish , three fish";$start = -1;while (($start = index($string, "fish",$start))!= -1){ print $start; print "\n"; $start++;}print rinde原创 2012-11-01 17:42:09 · 549 阅读 · 0 评论 -
perl基础-7 (Perl编程24学时教程)
#!usr/bin/perl -w#hash%hash1=("aaaa"=>1,"bbbb"=>2,"cccc"=>3,"dddd"=>4); foreach $key(sort keys %hash1) { print $key; print $hash1{$key}; print "\n"; } %hash2 = %hash1;原创 2012-11-01 17:38:07 · 590 阅读 · 0 评论 -
perl基础-4 (Perl编程24学时教程)
#!$s = 'test';@array1 = ("apple", "orange", 80, $s);@array2 = qw(apple orange 80 $s);print "@array1","\n";print @array1,"\n";print @array2,"\n";##################################原创 2012-10-29 19:53:21 · 645 阅读 · 0 评论 -
perl基础-2 (Perl编程24学时教程)
#!$radius =50;$area = 3.14*($radius**2);print $area ,"\n";##############################################if ('leon' =~ /\bleon\b/) {print ("I am leon!\n");}else {print ("who原创 2012-10-29 15:38:41 · 594 阅读 · 0 评论 -
PERL LWP
#! /usr/bin/perl use LWP::Simple; use Encode; my $targetfile = "C:/Users/Administrator/Desktop/123.txt"; open(TARGETHANDLE, ">".$targetfile); my $url='http://www.baidu.com/s?wd=百度'原创 2013-05-08 15:48:14 · 770 阅读 · 0 评论