Perl Redis 鏈接測試腳本

Redis鏈接測試腳本redis


1.部署環境ide


OS: Windows 7 簡體中文旗艦版 X64 SP1測試

Perl: ActivePerl-5.16.2.1602-MSWin32-x86-296513.msiserver

Redis: redis-2.8.19.zip for Windows ip

Perl Redis: Redis-1.966部署

安裝方法:ppm install Redisit


2.腳本內容class

# redis conn_test.pltest

use strict;List

use redis;

my ($key, $value) = ('list1', 'dbserver_01');


my $redis = Redis->new(server => '127.0.0.1:6379');

$redis->lpush($key, $value);

my $listlen = $redis -> llen($key);

print "List insert data length: $listlen \n";

my $reval = $redis->rpop($key);

my $listlen = $redis -> llen($key);

print "$key:$reval\n";

print "List pop data length: $listlen \n";

相關文章
相關標籤/搜索