in reply to Deferring variables
Hello Chuma,
A quick observation: if you change the “unspecified” value from 'a' to undef, you can simplify this:
if($par{'margin-left'} ne 'a'){ $actual = $par{'margin-left'} }elsif($par{'margin-horizontal'} ne 'a'){ $actual = $par{'margin-horizontal'} } else{$actual = $par{'margin'}}
to this:
$actual = $par{'margin-left'} // $par{'margin-horizontal'} // $par{'ma +rgin'};
which is easier to comprehend as well as to type. See Logical Defined Or.
Hope that helps,
Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
---|
In Section
Seekers of Perl Wisdom