Trending Up...

Trending Up...

Perl common usage

Perl common usage

2011-01-20 18:51:00

阅读数 655

评论数 0

Perl Mgmt Tips: Add "WITH ENCRYPTION" to SQL source file

在sql源文件中,将....Create Procedure AProc @Param1 IntAs....改为....Create Procedure AProc @Param1 IntWITH ENCRYPTIONAs....操作流程:1)将源文件读入内存2)找到文件内容 AS 这一行, 如果...

2006-05-05 13:24:00

阅读数 979

评论数 0

Perl Mgmt Tips: rename file

我在网上下载一些书籍是用rar切割成的一些rar文件,例如下载的文件是20060601=FILEpart01.rar20067802=FILEpart02.rar20062303=FILEpart03.rar而要快速解压,要把这些文件名改成FILEpart01.rarFILEpart02.rarF...

2006-05-05 12:03:00

阅读数 913

评论数 0

Web Mail Cgi

#! c:/perl/bin/perl.exeuse strict;use CGI;use Net::SMTP;my $q = new CGI;my $smtp = Net::SMTP->new(localhost);my $address = "webmaster/@rc3.or...

2006-02-22 22:18:00

阅读数 1137

评论数 0

A Cgi Get Cookies

#! c:/perl/bin/perl.exeuse CGI qw/:standard *table/;use strict;print header;print start_html(cookies);print h3(Cookies);print start_table(-border=>...

2006-02-22 22:16:00

阅读数 885

评论数 0

Guest Book Cgi

#!c:/Perl/bin/Perl.exeuse strict; # enforce declarations and quotinguse CGI qw(:standard); # import shortcutssub bail { # function to handle errors g...

2006-02-22 22:14:00

阅读数 3849

评论数 0

Upload File Cgi Sample

#! c:/perl/bin/perluse CGI;$q = new CGI;$upload_dir = "portraits";if ($q->param(portrait)) { &print_page_start; &write_fil...

2006-02-22 22:11:00

阅读数 1378

评论数 0

A Cgi Set Cookies

#! c:/perl/bin/perl.exeuse CGI qw/:standard/;$cookie = cookie(-name=>menus, -value=>on, -expires=>+30d, -path=>/);print header(-...

2006-02-22 22:05:00

阅读数 834

评论数 0

A Cgi print Environment Variables

#!c:/Perl/bin/Perl.exeuse CGI;$q = new CGI;print $q->header;foreach $var (sort(keys(%ENV))) { $val = $ENV{$var}; $val =~ s|/n|//n|g; $val...

2006-02-22 22:04:00

阅读数 739

评论数 0

First Perl CGI Example

#!c:/Perl/bin/Perl.exeuse strict;use CGI qw(:standard);print header, start_html(a simple cgi), h1(a simple example), start_form, "wh...

2006-02-22 22:00:00

阅读数 1093

评论数 0

在Windows上用Perl模拟Unix的Which命令

// 找岀notepad.exe在环境变量path中的哪些目录里C:/>perl -e "foreach(split(;, $ENV{path})) { print $_. if -e $_./"//notepad.exe/"; }output:C:/WIND...

2005-12-25 11:46:00

阅读数 1108

评论数 0

Perl Regex: extract words

#! perl -w$/ = "/n";#print ($0 =~ /([^////]*?)$/ ); this is a comment$foo = "word1 is2 the remain ...";($f1, $f2, $etc) = split( ...

2005-12-23 11:21:00

阅读数 846

评论数 0

Perl Regex: swap words

#!perl -w$/ = "/n";$_ = "one two remainder ... ";s/([^ ]*) *([^ ]*)/$2 $1/;print;

2005-12-23 11:21:00

阅读数 823

评论数 0

Perl Regex: usage of non capturing, (more powerful split)

#! perl -w$/ = "/n";use Data::Dumper;#usage of non capturing, (more powerful split)___FCKpd___0 = 12a34b5;print "string = ".___FC...

2005-12-23 11:19:00

阅读数 881

评论数 0

Perl Regex: non-captured parentheses

___FCKpd___0 = " abc def";if ( //s+(?:/w+)/s+(/w+)/) { if (defined($1)){ print "capture /$1 = $1";} print "/t"; ...

2005-12-23 11:18:00

阅读数 894

评论数 0

Perl Regex: multi-line match

#! perl -w$/ = "/n";$_ = "line_a/nline_b";if ( /a(.*)b/s ) {    print $1}

2005-12-23 11:17:00

阅读数 966

评论数 0

Perl: map print

#! perl -w$/ = "/n";my @array = qw/a b c d e f/;map {print} @array; #eqivalent to "print foreach @array" "print @array"...

2005-12-23 11:15:00

阅读数 838

评论数 0

Perl Regex: lookahead & lookforeword matching

#lookahead & lookforeword matching___FCKpd___0 = "tom cat";if ( /tom(?=cat)/ ) { print "find tom, follow by cat/n";}if ( /...

2005-12-23 11:14:00

阅读数 884

评论数 0

Perl Regex: execute perl code in RegEx

#execute perl code in RegEx___FCKpd___0 = "abcdef";if ( /abc(?{print "Hi Mom!/n";})def/ ) { print "crazy perl code in Reg...

2005-12-23 11:13:00

阅读数 855

评论数 0

Perl Regex: Extract Key Value Pair

#! perl -w$/ = "/n";$str = "Color=red";($k, $v) = ($str =~ m/(/w+)=(/w*)/);$ret = ($str =~ m/(/w+)=(/w*)/);print "Key = $k, ...

2005-12-23 11:12:00

阅读数 1157

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭