Thread (4 messages) flat view 4 messages, 4 authors, 2016-06-15
DORMANTno replies

[PATCH] Fix hash slice syntax error

From: Abhijit Menon-Sen <hidden>
Date: 2016-06-15 22:45:06
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Abhijit Menon-Sen <redacted>
---

At 2008-08-04 12:49:27 +0800, rctay89@gmail.com wrote:
$self->{@vars} evaluates to undef. i can't find any mention of using
arrays to dereference objects in the manual and elsewhere; is this a
mistake?
Yes, @vars would be interpreted in scalar context, which certainly isn't
the intended effect.

-- ams

 perl/Git.pm |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/perl/Git.pm b/perl/Git.pm
index 087d3d0..2ef437f 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -839,8 +839,8 @@ sub _close_hash_and_insert_object {
 
 	my @vars = map { 'hash_object_' . $_ } qw(pid in out ctx);
 
-	command_close_bidi_pipe($self->{@vars});
-	delete $self->{@vars};
+	command_close_bidi_pipe(@$self{@vars});
+	delete @$self{@vars};
 }
 
 =item cat_blob ( SHA1, FILEHANDLE )
@@ -928,8 +928,8 @@ sub _close_cat_blob {
 
 	my @vars = map { 'cat_blob_' . $_ } qw(pid in out ctx);
 
-	command_close_bidi_pipe($self->{@vars});
-	delete $self->{@vars};
+	command_close_bidi_pipe(@$self{@vars});
+	delete @$self{@vars};
 }
 
 =back
-- 
1.6.0.rc0.43.g2aa74
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help