On 9/11/06, Chad Perrin <[EMAIL PROTECTED]> wrote:
On Mon, Sep 11, 2006 at 08:02:36PM -0400, Jen Spinney wrote:
>
> The only difference between the blocks is two additional lines
> ($x[2]...) in the else block. I mean, I know I could write a
> subroutine that I could call inside the parentheses that would return
> a string (either empty or containing "$x[2]... depending on the result
> of the condition test), but that seems clunky. There seems like there
> should be a simpler way. Any thoughts? Thanks for any help! - Jen
Do everything without a conditional except those two lines -- do them
with an "unless".
Chad -
Thanks for the quick reply. How do I embed the "unless" inside
function call parentheses?
I've muddled around with the following, but it's not right. (I'm
probably embarrassing myself by showing I tried it this way... :) )
($x[0], $time1,
$x[1], $time1,
$x[2], $time2, unless $color eq $B_COLOR
$x[3], $time2, unless $color eq $B_COLOR
... )
- Jen
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>