Time of Update: 2014-10-26
標籤:des style blog http color os ar sp div wget http://www.cpan.org/src/5.0/perl-5.20.1.tar.gztar
Time of Update: 2015-04-29
標籤:perl 上下文 列表 標量 逗號運算式 本文由文章《perl標量上下文和列表內容相關的一個問題》整理而來,說明了為什麼在某些情況下,標量上下文中使用”列表“無法得到本身元素的個數,以及如何獲得你所期望的結果。1. “列表”在標量上下文中並非一定會得到元素的個數或許你覺得這個標題有一些奇怪:按照Perl
Time of Update: 2015-01-22
標籤:perlIf it is a small program, you can use this way: C:\Rebecca\script\perl>perl -d calculate.pl Loading DB routines from perl5db.pl version 1.39_10Editor support available. Enter h or ‘h h‘ for help, or ‘perldoc perldebug‘ for
Time of Update: 2015-01-22
標籤:perlYou need to usemodule: Unicode::Map Where to get it?-http://search.cpan.org/~mschwartz/Unicode-Map-0.112/Map.pmDownload Unicode-Map-0.112.tar.gz How to install it?-unzip the file andgo the
Time of Update: 2015-01-16
標籤:perl 字元加法 爆破 #!/usr/bin/perl -wsub add_32to126{ my $word = $_[0]; $last_char_num = ord(substr($word,-1,1))+1; if($last_char_num == 127){ chop($word);
Time of Update: 2014-11-28
標籤:io sp on bs amp as nbsp res 學習 運算子:1.operand operator expression statement2.算術運算子 + - *
Time of Update: 2014-10-26
標籤:style blog color ar 使用 for sp 檔案 div 前幾天用到了Perl語言,主要看了一下Perl中的Regex,在各種網頁語言中,Regex在處理字串的時候十分
Time of Update: 2014-10-11
標籤:style blog color os 使用 ar for 檔案 sp #!/usr/bin/perl -w@array = qw(a b c d);foreach (@array) {
Time of Update: 2014-08-24
標籤:style blog color os 使用 io ar div log 發現居然沒有輸入文本和輸出文本,折騰了一晚上,到了半夜終於搞懂了:官方的Manual上這麼寫的:The
Time of Update: 2014-08-17
標籤:perl1、unless控制結構條件為假時執行,與if相反可以附帶else2、Until控制結構條件為假時執行,一直執行到條件為真;3、條件修飾詞效果等同於:類似的模式:4、裸塊控制結構{ body;body;....}有利於為臨時變數圈定有效範圍5、elsif子句6、自增、自減同c語言7、for 用法同c語言8、for與foreach在perl中,兩者等價,優先選擇純正的foreach9、5種迴圈塊:for、foreach、while、until、裸塊last
Time of Update: 2014-07-22
標籤:os 資料 art for re c #!/usr/bin/perl# name: logcalc.pl# calc the amount of access urluse strict;use&nb
Time of Update: 2014-07-15
標籤:des style http color strong 檔案 Perl File Handling: open, read, write and close files#====================Opening filesSolution 1:Opening a file
Time of Update: 2018-12-08
轉移自自己原來在YourBlog上的Blog,寫於2004-3-11 13:05:48看了Jackey的“Windows下BugZilla安裝實錄”,按照文中的方法安裝成功,不過Jackey在實錄(二)中對於Perl模組的安裝好像不是很妥當。 看實錄(二)中模組的安裝是到CPAN網站上去下載,還需要nmake等編譯器,感覺還是比較複雜。 在Windows下安裝ActivePerl後Perl模組專門有Windows版的,這些Windows版的模組可以用ppm直接安裝的,在這裡可以下載。
Time of Update: 2018-12-08
我們在linux常常用到一個程式需要加入參數,現在瞭解一下 perl 中的有關控制參數的模組 Getopt::Long ,比直接使用 @ARGV 的數組強大多了.我想大家知道在 Linux 中有的參數有二種形式.•長參數 –help•短參數 -h也就是-和–的分別.–表示完整參數.-表示簡化參數.在 Perl 的這個模組中也支援這二種方法.這要介紹的二 Getopt 其實有二個模組,一個叫 Getopt::Long 一個叫 Getopt::Std.下面就只介紹 Getopt::Long
Time of Update: 2018-12-08
之前總不重視自己的部落格,上回一丟才心疼,現在重視起來,決定定期備份sql。寫個小指令碼如下:複製代碼 代碼如下:#!/usr/bin/perluse warnings;use strict;use MySQL::Backup;use Mail::Sender;open my $tmp_sql, '>', "backup.sql";my $mb = new MySQL::Backup('dbname', 'localhost', 'dbuser', 'dbpasswd',
Time of Update: 2018-12-08
文法 建立'引用'僅有兩種方法,使用它也是兩種。 建立引用 建立規則 1 如果你在一個變數前加一個'/'號,你就得到了這個變數的'引用'。 $aref = /@array; # $aref 儲存著指向@array的'引用' $href = /%hash; # $href 儲存著指向%hash的'引用' 當你把'引用'儲存在類似 $aref 或 $href的變數中,你就可以象操作其他標量一樣copy或儲存它。 $xy = $aref;
Time of Update: 2018-12-08
我的第一個用於生產環境的perl指令碼,雖然不是很優秀,但也邁出了紮實的一步 領導有任務,給一批IP列表,ping每一台機器,如果沒有響應就發郵件通知,通知的郵件需要分開,不能通知一個列表,得一封一封的通知.用到email::send模組,因為需要用到Gmail複製代碼 代碼如下:#!/usr/bin/perl use warnings; use strict; use Email::Send; use Email::Send::Gmail; use
Time of Update: 2018-12-08
1、單行(大檔案處理):複製代碼 代碼如下:my $oneline = <$FL> 或while($line=<H>){ }2、讀取全部(小檔案處理): 複製代碼 代碼如下:open (my $in, "path ") or die "open error: $! "; my @lines = <$in> ;3、讀3行(大檔案及特殊處理需要): 複製代碼 代碼如下:open (my $in, "path ") or die "open error: $! ";
Time of Update: 2018-12-08
在networking方面,最基礎的是BSD socket編程,但往往perl入門時在這個方面,最頭疼的無疑是如何開始,如何Step by step。最好的藥方就是Example,一段完整的可以運行(working)的代碼,通過實踐來感受遠比看枯燥的manual來得深刻。
Time of Update: 2018-12-07
來自:http://www.perlfect.com/articles/sorting.shtml perl 比較操作符列表: NumbersStrings<lt>gt<=le>=ge==eq<=>cmp!=ne <=> 和cmp的詳細解釋: Relation of $a and $bValue Returned by $a <=>$a greater than $b1$a equal to $b0$a less than