rightfield has asked for the wisdom of the Perl Monks concerning the following question:
This is the subroutine:print_if(\*FH,'AXS ',$aOrder->{rx_OD_Axis},$aOrder->{rx_OS_Axis});
Thank you for your help. Warm regards,sub print_if { my($FH, $orderKey, $odVal, $osVal) = @_; #if (!defined $odVal) {$odVal = 0;} #if (!defined $osVal) {$osVal = 0;} if (!(length($odVal) > 0)) {$odVal = "0";} if (!(length($osVal) > 0)) {$osVal = '0';} if ($odVal > 0 || $osVal > 0) { print $FH $orderKey.' '.$odVal.' '.$osVal."\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: default value for a scalar
by pc88mxer (Vicar) on Apr 19, 2008 at 20:56 UTC | |
by rightfield (Sexton) on Apr 19, 2008 at 22:08 UTC | |
|
Re: default value for a scalar
by jwkrahn (Abbot) on Apr 19, 2008 at 21:20 UTC | |
by rightfield (Sexton) on Apr 19, 2008 at 22:07 UTC | |
|
Re: default value for a scalar
by mscharrer (Hermit) on Apr 20, 2008 at 10:22 UTC |