Time of Update: 2018-12-03
open(FILE,”這個檔案的路徑”);@content=<FILE>;$lineCount=@content; for($item=0;$item<$lineCount;$item++){$tileContent=$content[$item];$item++;If(tileContent =~^/~)#找到開頭是以 ~ 的行{$ComponentContent=$content[$item];$item++;If($ComponentContent
Time of Update: 2018-12-04
In my current project, it has some old code in PERL and new code in both PERL and PHP. The PHP and PERL code need connect each other, especially the session variables. Currently, we need PHP to get Perl session variables. Searching on google,
Time of Update: 2018-12-04
有的時候我們會需要處理到檔案的一些屬性,比如說唯讀、隱藏之類的,我這裡大概說下在WIN32下如何取得和修改檔案的屬性。 需要: use Win32::File; 然後使用如下方法: my $set;#取得檔案的屬性 Win32::File::GetAttributes($name, $set);#設定檔案的屬性 Win32::File::SetAttributes($name, ARCHIVE);在perldoc裡,可供設定的屬性如下:ARCHIVE
Time of Update: 2018-12-04
############################################################ 功能:取目前時間# 參數:無# 傳回值: 按照YYYYMMDDHHMMSS的格式返回時間###########################################################sub get_time{ my( $sec, $min, $hour, $day, $month, $year ) = localtime( time()
Time of Update: 2018-12-05
(defun python-shell() "make a python shell" (interactive) (switch-to-buffer (make-comint "python" "python" nil "-i")))(defun groovy-shell() "make a groovy shell" (interactive) (switch-to-buffer (make-comint "groovy" "groovysh" nil)))(defun perl
Time of Update: 2018-12-03
轉載自:http://club.topsage.com/thread-464914-1-3.html關於學習PerlPerl是一門很有用的語言,可以用它來做很多事。然而,它也僅是一門語言,掌握了Perl,你只是掌握了Computer領域的一小塊知識。在學習Perl前,請明確你的學習目的,並採用正確的學習方法和資源。(一)學習目的你學Perl的目的是什嗎?要實現你的目的,光有Perl夠嗎?讓偶幫你分析看看。1. 我想當一名System
Time of Update: 2018-12-04
使用格式與常用方法(父類IO::Handle與IO::File的通用方法就不在下文中說明了):===========================================================================================================-----------------------------------------------------------------------------匯入IO::Socket包:use
Time of Update: 2018-12-05
我建了一個 Freeswitch 核心研究 交流群, 45211986, 歡迎加入, 另外,提供基於SIP的通訊伺服器及用戶端解決方案, 承接 sip/ims 視頻用戶端開發,支援接入sip軟交換,ims核心網,支援 語音,視頻,即時通訊功能,視頻格式支援 h263,h264,mpeg4 軟編軟解,提供硬體編解碼介面對接,提供伺服器,有興趣請聯絡我。freeswtich支援 lua, perl, php等指令碼語言編寫dialplan, 類似asterisk
Time of Update: 2018-12-05
()分組例:($fruit,$color)=/(.*)/sis/s(.*)/;每個加括弧的值都是列表的傳回值 =~這個運算子並不進行賦值,它只是取出右邊的運算子,並使它對左邊的變數進行操作$field =~ s/^/s+|/s+$//g;-去掉行頭行尾的空格 //i不區分大小寫next if ($Var=~ /^AbC/i); $1,$2,$3...當將括弧用於perl的Regex時,由每個帶括弧的運算式進行匹配的目標字串將記錄在$1,$2,$3...中如,/(/d{3})-(/d{4})-(
Time of Update: 2018-12-05
#!/usr/bin/perluse warnings;use strict;my$flag=0;my$a;while(<DATA>){ if(/^>/) { $flag = 1; $a = 0; } if($flag ) { print $_; $a++; } if($a == 3) { $flag = 0;
Time of Update: 2018-12-05
最近2天用perl編程,寫控製程序、做cgi。發現這真是一個好東西啊。代碼非常簡練,而且不容易出錯。我作為一個新手寫了一天,居然沒有出過幾次錯。最終封裝了幾個做cgi的類,一個處理傳入參數,一個處理模版替換,一個處理資料庫連接。然後實戰了一把,寫一個普通的查詢頁面只需5分鐘。呵呵。類庫的實現參照了DotNet的設計。最值得一提的是模版替換那個類,現在可以做到程式邏輯和頁面分離了,只要往他裡面傳資料結構(主要是雜湊表)就可以實現自動替換,是不是有點像DotNet裡面的資料繫結呢?呵呵。以後還可以繼
Time of Update: 2018-12-05
指令:# 說明:註解符號Remark宣告 範例:#本程式是一個示範註解說明 -------------------------------------------------------------------------指令:print 文法一:print Filehandle LIST
Time of Update: 2018-12-05
這次的任務是統計一周內的top500詞條。資料來源:來自於oracle資料庫。需求:產生excel表格並發送郵件給相關人。
Time of Update: 2018-12-05
Perl命令列http://developer.51cto.com/art/201007/213087.htmPerl模式比對中的特殊字元用法指南http://developer.51cto.com/art/201007/213056.htmPerl Hash用法之入門教程http://developer.51cto.com/art/201007/213695.htm常見Perl
Time of Update: 2018-12-05
中國移動遊戲頻道,遊戲玩家套餐包中的玩家樂園遊戲上線啦,很開心,作為開發人員之一,加了那麼多班,眼看出了成果,激動一下下,哈哈,隨之而來的是各種各樣的pv、uv的資料統計。 領導問:還會寫perl啊? 我答:會一些。 進入這個公司後,確實涉及到過perl指令碼,所以稍稍簡單的還能寫,所以對於領導交代的access_log日誌的處理,我寫完了,貼到自己部落格裡,以備下次回憶。
Time of Update: 2018-12-03
VC中調用PERL子程式作者: 來源:zz 發表時間:2007-02-09 瀏覽次數: 2691 字型大小:大 中 小因需要,要在VC中調用PERL子程式對檔案進行處理。通過看PERL說明文檔折騰了好長時間,可以運行。現與大家分享,呵呵,希望對大家有所協助^ -^1在工程檔案中加入 perl58.dll2. 在VC中加入標頭檔#include <EXTERN.h>#include <perl.h>3.void perl_sub(char*a){int
Time of Update: 2018-12-04
#!/usr/bin/perluse strict;use warnings;use DBI;opendir (DIR,"dirpath/") ||die "can not open it";my @connect = readdir(DIR);closedir DIR;my $dir_need;foreach my $con (sort @connect){ if ($con =~ /-[0-9]{2}-[0-9]{2}_/){ $dir_need = $con; }
Time of Update: 2018-12-04
sort函數sort LISTsort BLOCK LISTsort SUBNAME
Time of Update: 2018-12-04
大家在perl裡面很喜歡用split這個函數,它很好用,但有兩個方面要注意,我舉例說明my $message = "word|words";my @word = split('/|',$message);print $word[0];結果是正確的,顯示word;但是如果你寫成my @word = split("|",$message) or my @word =
Time of Update: 2018-12-04
######################### 1001 ############################## use 5.010;while(<>){ my @num = split; say $num[0] + $num[1];}######################### 1048 ##############################my $n = 12;my $sum = 0;while ( $n -- ){ chomp(my