Created
July 6, 2017 05:52
-
-
Save kacchan822/bcdddcb2c44cf2602995445eb8bb6434 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use Cache::Memcached; | |
my $memcached = Cache::Memcached->new({ | |
servers => ["127.0.0.1:11211"] | |
}); | |
print "Set (key, hoge) exptime:12sec\n"; | |
$memcached->add('key', 'hoge', 12); | |
print $memcached->get('key'), "\n5sec sleeping...\n"; | |
sleep 5; | |
print $memcached->get('key'), "\n5sec sleeping...\n"; | |
sleep 5; | |
print $memcached->get('key'), "\n5sec sleeping...\n"; | |
sleep 5; | |
print $memcached->get('key'), "<-- should be none value\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment