韩半仙

  博客园  ::  :: 新随笔  ::  :: 订阅 订阅  :: 管理

随笔分类 -  perl

text processing language
摘要:本章节实在是简单的不想写,太多雷同的部分了。understanding conditional statements1. conditional execute code selectivelyif(condition){ statements)2. conditionals my provide alternative codeif (condition){ statement_1}else{ statement_2}beginning with version 5.10, perl also provides a switch statement -use given ... 阅读全文
posted @ 2012-02-19 19:25 韩英武 阅读(288) 评论(0) 推荐(0)

摘要:Perl的特殊符号 @ 数组 $x{} x名字前面是美元符号($),后面是花括号({}),则其为 hash 元素 % 要引用整个 hash,使用百分号(“ )作为前缀。前面几页中使用的 hash 的名字为%family_name。 $! 系统产生的一些可读的信息,... 阅读全文
posted @ 2012-01-18 10:56 韩英武 阅读(400) 评论(0) 推荐(0)

摘要:今天刚发现原来一个网友共享Perl资料的邮箱已经不可用了,于是动手整理手中的资料,想自己提供共享;资料上传在“新浪爱问”,下载链接整理在此处便于查找;不要求积分,直接下载,这些本也是从各位网友那里得来的..这些书,基本上,我还都没看..Learning.Perl.4th.Edition.Jul.2005.chmLearning.Perl.5th.Edition.Jul.2008.pdfProgramming_Perl_En_3rd_Edition.chmProgramming_Perl_中文版_3rd_Edition.pdfThinking.In.Perl.中文版.pdfEmbedding.P 阅读全文
posted @ 2012-01-16 19:34 韩英武 阅读(1287) 评论(0) 推荐(0)

摘要:综述,提纲 阅读全文
posted @ 2012-01-14 18:22 韩英武 阅读(183) 评论(0) 推荐(0)

摘要:1. values represent data.variables contain values:$number = 42;variable valueperl provides several types of values:integers/arrays/strings/hashes/scalars/referenceperl used context to determine type.2. the scope of keyword: my#!/usr/bin/perl#use strict;use warnings;main(@ARGV);my $decimal = 23456... 阅读全文
posted @ 2011-12-25 17:45 韩英武 阅读(356) 评论(0) 推荐(0)

摘要:一般性的语法:#!/usr/bin/perluse strict;use warnings;main(@ARGV);sub main{ message("This is the template.pl exercise file from Perl 5 Essential Training.");}sub message{ my $m = shift or return; print("$m\n");}sub error{ my $e = shift || 'unkown error'; print("$0: $e\n" 阅读全文
posted @ 2011-12-05 00:06 韩英武 阅读(264) 评论(0) 推荐(0)

摘要:open a file and return its number of lines.Version 1st:#!/usr/bin/perluse strict;use warnings;my $filename = "linesfile.txt"; # the name of the fileopen(FH, $filename); # open the filemy @lines = <FH>; # read the fileclose(FH); # close the filemy $count = scalar @lines; # the number 阅读全文
posted @ 2011-12-02 00:51 韩英武 阅读(208) 评论(0) 推荐(0)

摘要:1. prerequistites:have a basic understanding of programmingshould have experience writing working code in modern programming language: C, java, JSP, PHP, Python.Use a system with Perl 5 installed. recommended: Perl 5.10.have a text editor.2. what is Perl?Perl is a programming language.it's inter 阅读全文
posted @ 2011-12-01 01:21 韩英武 阅读(201) 评论(0) 推荐(0)