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

perl 204

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

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

2015-12-14 516

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

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

2015-12-14 438

#Perl
正则表达式求素数

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

2015-12-14 661

#Perl
Perl 操作 Windows 的系统服务

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

2015-12-14 347

#Perl
Perl 播放 wav 文件

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

2015-12-14 339

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

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

2015-12-14 708

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

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

2015-12-14 1,021

#Perl
可以在新浪网盘里面批量获取搜索内容的地址及下载文件

use LWP::UserAgent; use HTML::TreeBuilder; use LWP::Simple; use URI; use Encode; @list_url…

2015-12-14 380

#Perl
获取ab测试结果的rps

while (<>){ printf("%20s\t",$1) if /Server Software:\s+(.*?)\n/; printf("%10d\n",$1)…

2015-12-14 498

#Perl
$& $` $' 格式匹配

#!/usr/local/bin/perl while ($inputline =(<>) ) { while ($inputline = ~/\b[A-Z]\S+/g…

2015-12-14 451

#Perl
Perl快速入门

#!/usr/bin/env perl # # 基本语法 # ;用于语句结束符 # #用于注释 # ""用于表示字符串,变量可以在""中被替换,如: $var = "world."…

2015-12-14 297

#Perl
哈希的运用

print "请输入哈希的键值,输入结束后将统计每个哈希键输入的次数:\n"; while($line=<STDIN>){ chomp($line); if(exist…

2015-12-14 168
1 8 9 10 11 12 17