#!/usr/bin/perl
use strict;
use Redis;
my $redis = Redis->new(server => '192.168.119.131:8080');
my $num;
my $i;
for ($i=1;$i<10000000;$i++){
$num = hash($i);
$redis->select($num);
$redis->set($i=>"--hello--$i-->$num");
print "==$i-->$num==\n";
}
sub hash(){
my $uid = shift;
return $uid%10;
}
本文出自 “技术�潘�” 博客,谢绝转载!