From: David Christensen Date: Mon, 04 Aug 2008 15:01:44 GMT Subject: Re: [git/perl] unusual syntax? Message-ID: <77D646CF-448B-434A-B969-653931B4A756@endpoint.com> In-Reply-To: > sub _close_hash_and_insert_object { > my ($self) = @_; > > return unless defined($self->{hash_object_pid}); > > my @vars = map { 'hash_object_' . $_ } qw(pid in out ctx); > > command_close_bidi_pipe($self->{@vars}); > delete $self->{@vars}; > } > $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? This is a hash slice notation, returning an array of hash values matching the corresponding keys. 5.10 removed some syntax warts in the case of hash slices; this is more portably expressed as @{$self} {@vars}; this should work in 5.10 and earlier versions, and so is the preferred syntax. Regards, David -- David Christensen End Point Corporation david@endpoint.com