in reply to Re^3: Arrow Operator Question
in thread Arrow Operator Question
use strict; use warnings; use Data::Dumper; use Test::More tests=>2; my $h = { b => { c => { d => 'value' } } }; my $g = $h->{b}{c}{d} if exists($h->{b}{c}) and exists($h->{b}{c}{d}); my $f = $h->{b}{c}{d}//undef; # Original Code is( $g, $f, $f ); is_deeply( $h, { b => { c => { d => 'value' } } }, 'no change' );
The difference between your various f's is not merely one of style, but one of requirements (which we really do not know).
|
---|