> 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
It is clear but doesn't do what I'm getting at. The seconde one *reads* like it but does not function how it *reads*. I want to assign it a value. If that value is missing I want to assign a second value, and here's the tricky part, if a particular variable says it is ok to. Othyerwise it should be empty. > clarity without good reason. Isn't it more important to say > what you mean than to tuck it all up tightly? Except I need to do this to about ten variabels all in a row. Which gives me 10 lines with Bob's way and 40 with my very first example. Boo for that! :) > > Joseph > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>