On Sep 22, Frank Geueke, III said:

display_nothing() if ($match_type eq 'none');
else
{
}

Now I like the reverse if because it takes up one line
instead of four (I like braces on their own lines -
see else).  But this error...

syntax error at
/usr2/login/fjg/hotspot_tracker/search_by_ip_or_mac.cgi
line 70, near "else"

...keeps coming up.  Is there a way to keep the
reverse if and use an else (or something like it) that
anyone knows of?  Thanks.  ~Frank

No, there isn't. Not with 'else', at least. You could use a ternary (hook) operator:

  ($match_type eq 'none') ?
    display_nothing() :
    display_something();

is like saying

  if ($match_type eq 'none') {
    display_nothing();
  }
  else {
    display_something();
  }

--
Jeff "japhy" Pinyan        %  How can we ever be the sold short or
RPI Acacia Brother #734    %  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to