From 2efb86d707f5c090edf788935d2f6245da0c4518 Mon Sep 17 00:00:00 2001
From: "Dmitry E. Oboukhov" <unera@debian.org>
Date: Sat, 12 May 2012 14:45:58 +0400
Subject: [PATCH] Call method works like if is described in perldoc.

(Previous variant works, too, but it was undocumented, so I kept it undocumented.)
---
 connector/perl/lib/MR/Tarantool/Box.pm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/connector/perl/lib/MR/Tarantool/Box.pm b/connector/perl/lib/MR/Tarantool/Box.pm
index c0701dcfff..05aeded69d 100644
--- a/connector/perl/lib/MR/Tarantool/Box.pm
+++ b/connector/perl/lib/MR/Tarantool/Box.pm
@@ -571,8 +571,14 @@ sub Call {
     $self->_debug("$self->{name}: CALL($sp_name)[${\join '   ', map {join' ',unpack'(H2)*',$_} @$tuple}]") if $self->{debug} >= 4;
     confess "All fields must be defined" if grep { !defined } @$tuple;
 
-    confess "Bad `unpack_format` option" if exists $param->{unpack_format} and ref $param->{unpack_format} ne 'ARRAY';
-    my $unpack_format = join '', map { /&/ ? 'w/a*' : "x$_" } @{$param->{unpack_format}};
+    confess "Required `unpack_format` option wasn't defined"
+        unless exists $param->{unpack_format} and $param->{unpack_format};
+
+    my $unpack_format = $param->{unpack_format};
+    $unpack_format = [ split /\s*/, $unpack_format ]
+        unless 'ARRAY' eq ref $unpack_format;
+
+    $unpack_format = join '', map { /&/ ? 'w/a*' : "x$_" } @$unpack_format;
 
     local $namespace->{unpack_format} = $unpack_format if $unpack_format; # XXX
     local $namespace->{append_for_unpack} = ''         if $unpack_format; # shit...
-- 
GitLab