Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] evaulation in one line

Expand Messages
  • merlyn@stonehenge.com
    ... Noah Hi there, Noah is there anyway to put this evaulation on one line? Noah next if ($community{$community_number}{$community_name}
    Message 1 of 2 , Sep 3, 2006
    • 0 Attachment
      >>>>> "Noah" == Noah <admin2@...> writes:

      Noah> Hi there,
      Noah> is there anyway to put this evaulation on one line?

      Noah> next if ($community{$community_number}{$community_name}
      Noah> != "") && ( $community_subname eq $loop_subname );
      Noah> next if ($community{$community_number}{$community_name}
      Noah> != "");

      Noah> I was thinking

      Noah> next if ($community{$community_number}{$community_name}
      Noah> != "") || (($community{$community_number}{$community_name} != "") && (
      Noah> $community_subname eq $loop_subname ));

      Noah> is there any other way to do this?

      I'd start with:

      my $some_meaningful_name = $community{$community_number}{$community_name};

      before you get to that expressions. First, it'll be faster to do that lookup
      only once. Second, it'll be a LOT easier on the reader's eyes.

      Third, the code != "" doesn't make sense to me. A numeric comparison
      to a string? What are you really trying to say?

      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.