develooper Front page | perl.perl5.porters | Postings from July 2013

Re: postfix dereference syntax

Thread Previous | Thread Next
From:
Dr.Ruud
Date:
July 7, 2013 00:16
Subject:
Re: postfix dereference syntax
Message ID:
20130707001623.29811.qmail@lists-nntp.develooper.com
On 04/07/2013 07:29, David Nicol wrote:

> $HoHoA->{abc}{def}${}[2]   # new-style ${$HoHoA->{abc}{def}}[2]

Which I assume is basically the same as $HoHoA->{abc}{def}[2].


perl -MData::Dumper -e'
   ${$HoHoA->{abc}{def}}[2];
   print Dumper( $HoHoA );

   ${$HoHoA->{abc}{def}}[2] = "test";
   print Dumper( $HoHoA );

   $v = ${$HoHoA->{abc}{def}}[2];
   print Dumper( $v );

   $v = $HoHoA->{abc}{def}[2];
   print Dumper( $v );
'

$VAR1 = {
           'abc' => {
                      'def' => []
                    }
         };

$VAR1 = {
           'abc' => {
                      'def' => [
                                 undef,
                                 undef,
                                 'test'
                               ]
                    }
         };

$VAR1 = 'test';

$VAR1 = 'test';

-- 
Ruud



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About