首页 软件开发 代码片段 perl ( Page 15 )

perl 204

#Perl
row模式下从binlog提取DML的回滚sql

#!/usr/lib/perl -w use strict; use warnings; use Class::Struct; use Getopt::Long qw(:confi…

2015-12-14 432

#Perl
通过web界面查询svn更新 

use 5.01; use Mojolicious::Lite;   get '/update' => sub { my $self = shift; my $resp=`s…

2015-12-14 594

#Perl
解压缩文件后按行读取并处理

糟糕的: my @Lines = qx(zcat $file); foreach my $line(@Lines){ .... } 漂亮的: open(FILE, '-|', "z…

2015-12-14 325

#Perl
perl Sys::Uptime模块使用例子

#!/usr/bin/perl -w #author:shenxiaoran use strict; use Sys::Uptime; my $nbrcpu = Sys::Upti…

2015-12-14 563

#Perl
子程序的运用

@a=(); #定义一个全局数组@a $a=0; #定义一个全局标量$a sub greet{ push(@a ,@_[0]); if($a==0){ print "hi ".@a…

2015-12-14 663

#Perl
Perl获取Linux操作系统版本

#!/usr/bin/perl system("uname -r"); system("uname -a");

2015-12-14 508

#Perl
Perl 使用 DBI 连接到 Oracle 数据库

$dbh = DBI->connect('dbi:Oracle:payroll','scott','tiger'); $dbh = DBI->connect("dbi:…

2015-12-14 434

#Perl
正则表达式求素数

(1 x ++$_) =~ /^1?$|^(11+?)\1+$/ || print "$_\n" while $_ < 1000

2015-12-14 659

#Perl
Perl 操作 Windows 的系统服务

#!/usr/bin/perl -w use Win32::Service; $host = ''; $status = Win32::Service::GetServices($…

2015-12-14 346

#Perl
Perl 播放 wav 文件

#!/usr/bin/perl -w use strict; use Win32::Sound; Win32::Sound::Volume(65535); while (<*…

2015-12-14 337

#Perl
Perl 查询域名对应的 IP 地址

use Socket; $site_name = 'www.oschina.net'; $address = inet_ntoa(inet_aton($site_name)); p…

2015-12-14 705

#Perl
使用Perl从UniProt中下载蛋白质序列

use strict; use warnings; use LWP::Simple qw(get); my $seq = downloadUniprot("P31749"); pr…

2015-12-14 1,017