
Perl
文章平均质量分 62
wunderup
这个作者很懒,什么都没留下…
展开
-
Perl学习之哈希hash
一、什么是哈希哈希是一种数据结构,和数组类似,可以将值存放到其中,或者从中取回值。但是,和数组不同的是,其索引不是数字,而是名字。也就是说,索引(这里,我们将 它叫key)不是数字而是任意的唯一的字符串。key可以是任意的字符串,你可以使用任何的字符串作为key,但它们是唯一的。另一种思考hash 的方法是,把它看作一堆数据(a barrel of data),每一个数据都有一个相应的标签。可以通原创 2010-05-06 10:37:00 · 662 阅读 · 0 评论 -
正则表达式的十二罗汉
<br /><!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;}原创 2010-11-21 14:05:00 · 687 阅读 · 0 评论 -
perl 多行注释
<br /><!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;}原创 2010-11-09 17:04:00 · 971 阅读 · 0 评论 -
Perl文件及目录操作
<br /><!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;}原创 2010-11-09 15:04:00 · 729 阅读 · 0 评论 -
Perl文件及目录操作
<br /><!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;}原创 2010-11-10 09:35:00 · 585 阅读 · 0 评论 -
Perl字符串基本操作详解
<br /><!-- /* Font Definitions */ @font-face {font-family:"MS Mincho"; panose-1:2 2 6 9 4 2 5 8 3 4; mso-font-alt:"MS 明朝"; mso-font-charset:128; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-536870145 1791491原创 2010-11-10 09:18:00 · 1251 阅读 · 0 评论 -
perl几个读取文件命令
<br /><!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;}原创 2010-11-09 14:04:00 · 726 阅读 · 0 评论 -
PERL: 获取system输出
<br />1.使用重定位的方法,比如:system "path >> d://path.txt";然后再对临时文件 path.txt 处理 2.使用 ` (这个是tab上面的`) <br />就是这个东东,弄了好久才搞明白...一定是 TAB 上面的 ` 不是 ~,也不是单引号'my $path = `path`;<br />print $path; 3.使用qx////是分隔符,也可以用其他符号代替,比如!,[],()my $path = qx/path/;<br />print $path;原创 2010-11-08 16:10:00 · 1780 阅读 · 0 评论 -
Perl实现的Expect的telnet应用
一段简单的perl实现的telnet脚本,目的是打印当前的系统环境变量#!/usr/bin/perluse Expect;use strict;my $timeout = 20;my $cmd = "telnet";my @params = qw/127.0.0.1 8110/;my $exp = Expect->spawn($cmd, @params) or di原创 2010-05-10 16:48:00 · 878 阅读 · 0 评论 -
Perl - How do I set environment variables
Perl - How do I set environment variables? http://www.devdaily.com/blog/post/perl/set-environment-variables-in-perl-programs Perl programming FAQ: How do I set environment variables in a Pe转载 2010-05-07 21:25:00 · 763 阅读 · 0 评论 -
perl 子程序sub
一、定义 子程序即执行一个特殊任务的一段分离的代码,它可以使减少重复代码且使程序易读。PERL中,子程序可以出现在程序的任何地方。定义方法为: sub subroutine{ statements; } 二、调用 调用方法如下: 1、 用&调用 &subname; ... sub subname{ ... } 2、先定义后调用 ,可以省略&符号 sub subname{ ...转载 2010-05-05 17:57:00 · 668 阅读 · 0 评论 -
perl中的foreach
From Wiki For each (or foreach) is a <a title="Computer language" href="http://en.wikipedia.org/wiki/Computer_language">computer language idiom for traversing items in a collection. Foreach i转载 2010-05-06 10:52:00 · 1566 阅读 · 1 评论 -
Perl正则表达式
<br /><!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;}原创 2010-11-21 14:17:00 · 600 阅读 · 0 评论