Redis::Script - wrapper class for Redis' script
# OO-interface use Redis; use Redis::Script; my $script = Redis::Script->new(script => "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}"); my ($key1, $key2, $arg1, $arg2) = $script->eval(Redis->new, ['key1', 'key2'], ['arg1', 'arg2']); # Functional use Redis::Script qw/redis_eval/; my ($key1, $key2, $arg1, $arg2) = redis_eval(Redis->new, "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", ['key1', 'key2'], ['arg1', 'arg2']);
Redis::Script is wrapper class for Redis' script.
$script->eval($redis:Redis, $keys:ArrayRef, $args:ArrayRef)
eval executes the script by EVALSHA command. If EVALSHA reports "No matching script", use EVAL instead of EVALSHA. Redis will cache the script of EVAL command, so EVALSHA will succeed next time.
eval
EVALSHA
EVAL
If use_evalsha option is false, eval does not use EVALSHA command.
use_evalsha
$script->exists($redis:Redis)
exists reports if $redis caches the script.
exists
$redis
$script->load($redis:Redis)
Load a script into the scripts cache, without executing it.
Redis.pm
Redis::Fast
Description of EVAL
Copyright (C) Ichinose Shogo.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Ichinose Shogo <shogo82148@gmail.com>
To install Redis::Script, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Redis::Script
CPAN shell
perl -MCPAN -e shell install Redis::Script
For more information on module installation, please visit the detailed CPAN module installation guide.