讀文檔: 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
標籤:#!/usr/bin/perl -w#Description:rerun eod job group by system#Auther:Suzm#Date :2015-06-23use DBI;use Thread;use strict;push( @INC, $ENV{TPMS_EOD_PERL_LIB} );require public
轉載地址:http://blog.csdn.net/omohe/article/details/1562515使用Perl從檔案中讀取字串,一般有兩種方法:1. 一次性將檔案中的所有內容讀入一個數組中(該方法適合小檔案):open(FILE,"filename")||die"can not open the file: $!";@filelist=<FILE>;foreach $eachline (@filelist) { chomp $eachline;}close
一個轉換程式,簡單的把DNA序列中的A轉變成T,第一種情況沒有使用私人變數。複製代碼 代碼如下:#!/bin/perl#下面是一段DNA序列 $DNA=ATTATATAT;#這裡是我們的序列 $result=A_to_T($DNA); print "I changed all $DNA A to T, and the we get the result $result\n\n"; sub A_to_T { my ($input)=@_;
從而使得有些字元(尤其是寬字元)無法正確地顯示,即不再是utf-8格式了。解決辦法:開啟輸出檔案時即指定編碼格式,就不會出現輸出檔案開啟以後亂碼的情況了。普通的預設open輸出檔案:複製代碼 代碼如下:open(OUTPUT,'>>output.txt')||die"can not open the file: $!";定義指定編碼格式檔案(或者成為使用Perl建立一個指定編碼格式的檔案):複製代碼 代碼如下:open OUTPUT, ">:encoding(utf-8)",
windows XP安裝配置Perl下載:Apache 1.3.29 :ActivePerl :http://activestate.com/store/download.aspx?prdGUID=81fbce82-6bd5-49bc-a915-08d58c2648ca進入View archive of older releases 下載ActivePerl-5.6.1.624-TRIAL2-MSWin32-x86-multi-thread.msimod_perl
代碼: http://xxxxx/cgi/perl-cgi.cgi?name=itech&url=itech.cnblogs.com&p1=test1#!/usr/bin/perl -wT#should use strict and warnninguse warnings;use strict;use CGI;#to debug erroruse CGI::Carp qw(warningsToBrowser fatalsToBrowser);#or debug from com