Dan Muey wrote: > Howdy list. > I'm trying to one lineify this: > > my $guts = $firstchoice || ''; > if(!$guts && $use_second_choice_if_first_is_empty) { > $guts = $secondchoice; > } > > Basically > my $guts = $firstchoice || $secondchoic || ''; > Would be perfect except I only want to let it use $seconchoice if > $use_second_choice_if_first_is_empty has a true value. > This does not work like I want but illustrates the goal if you read it our loud. > my $guts = $firstchoice || $secondchoic if $use_second_choice_if_first_is_empty || > ''; > > Is that possible to do with one line? > > TIA > > Dan
I don't know Dan, it looks like you already said it clearly in the first cnstruct above. I would not discard that clarity without good reason. Isn't it more important to say what you mean than to tuck it all up tightly? Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>