On Thu Jul 30 17:42:49 2015, NHORNE wrote:
Show quoted text> It seems to me that if the server argument is given an IP address
> only, that the port should default to 6379. This would make it
> consistent with CHI::Driver::Memcached which defaults to 11211 if you
> don't give a port number.
Default port would be nice, but I'm not sure this module is the right place for it. CHI::Driver::Redis is a simple wrapper around Redis module and passes through the "server" option. In fact, I think CHI::Driver::Redis shouldn't be setting default value for "server" but let Redis.pm handle it especially since it is possible to not use "server" option.
My feeling is that it would be better to add support for default port in Redis module. It looks like Redis module uses "server" attribute as IO::Socket::INET PeerAddr without any processing. I think it is possible to use PeerPort for default port:
IO::Socket::INET->new(PeerAddr => $self->{server}, PeerPort => 6379);