Making References References can be created in several ways.By using the backslash operator on a variable, subroutine, or value. (This works much like the & (address-of) operator in C.) This typically creates another reference to a variable,
由於linux上處理word和ppt比較麻煩,而且有檔案格式專利的問題,所以以下操作全部在Windows下面進行。首先需要安裝Microsoft Save as PDF附加元件,官方:http://www.microsoft.com/zh-cn/download/details.aspx?id=7安裝成功後可以手工將文檔另存新檔pdf。需要引用“Win32::OLE”模組use Win32::OLE;use Win32::OLE::Const 'Microsoft Word';use Win32
例子:假設在fred and barney went bowling last night 上使用/fred.+barney/進行匹配。我們知道Regex將匹配上,下面我們具體的講解這一個過程:首先,子模式fred 將匹配其對應的字串。模式的下一部分是.+,它將匹配除了分行符號之外的任一字元,次數大於等於一。但,由於加號(+)是貪婪的;它將儘可能的進行匹配。因此,它將匹配剩餘的所有字串,包括night。現在對banrey
use strict;use warnings;#數值比較大小和字串比較大小 my $str1="1 -the first str"; my $str2="1 - the second str"; if($str1==$str2) { print "numerically equal\n"; } if($str1 eq $str2) { print "stringwise equal\n" ; } print "a.b"."haha" 有用的測試範例: use strict;use
轉自:http://perl.apache.org/docs/general/perl_reference/perl_reference.html use(), require(), do(), %INC and @INC Explained The @INC array@INC is a special Perl variable which is the equivalent of the shell's PATH variable. Whereas PATH contains a
前面一節介紹了Perl中的基礎資料型別 (Elementary Data Type)及其使用方式,本節介紹一下分支迴圈控制及IO。 Perl中的分支迴圈在文法上和C家庭語言的文法很相似,關鍵字包括: If / else, for ,while 。 前面已經講過,Perl中代碼塊用大括弧{}圍起來,運算式以分號結尾,這些都和C相似, 但在Perl中,使用if for