#!/usr/bin/perl -wuse strict;use 5.010;sub getDigit($$){ # get digit from num my($num ,$flag) = @_; return $num/(10**$flag)%10;}sub radixSort($/@){ my ($size,$arr) = @_; my @sortArr; my $i;my $k; for(0..3){ my @count =
if (open(MYFILE, "E:\\Perl\\Code\\string.pl")) { print("success open the file\n");#############################################output all of MYFILE's content 1############################################ print(<MYFILE>); print("=========1=
測試指令碼如下: my $run_app_path = "c://exit_value.pl";my $ret_val = system( $run_app_path );print "system value is : $ret_val/n";$ret_val = $ret_val >> 8;print "return value is : $ret_val/n";exit 0; 其中,exit_value.pl 指令碼內容如下: use strict;use warnings;
讀文檔: http://search.cpan.org/~gaas/Digest-MD5-2.39/MD5.pm後, 非常有用章段:This is useful when calculating checksum for files: use Digest::MD5; my $file = shift || "/etc/passwd"; open(FILE, $file) or die "Can't open '$file': $!"; binmode(FILE);
用VS來使用C#的應該知道有個自動屬性,類似於public int MyProperty { get; set; }他幫你自動產生get/set方法,還幫你把這些方法綁定到該屬性上,很方便的說,但是C++的IDE裡沒有這個功能的,而且我們C++需要寫 _declspec(property(put=setJobID, get=getJobID)) unsigned long jobID; void setJobID(unsigned long
寫作意圖:Linux系統內建的netstat在很多時候抓資訊會發現耗CPU很高,特別是在做一些監控系統的時候,發現如果使用了netstat,監控系統本身會造成系統負載比較高,因此試著用perl寫下,time測試比內建的netstat更快更節省資源,歡迎批評,呵呵。#!/usr/bin/perl# Written by FinalBSD at 2008-11-20.# The netstat original written by C# is expensive to me, so this