in reply to and multiple statements

print "this is bad", next;
means
print("this is bad", next);

Disambiguate with parens

($istrue) or print("this is bad"), next; ($istrue) or (print "this is bad"), next;

Or use do as previously shown

($istrue) or do { print "this is bad"; next; };

But an if would be clearer.

if (!$istrue) { print "this is bad"; next; }

Update: Added missing "!" as per reply.

Replies are listed 'Best First'.
Re^2: and multiple statements
by cmac (Monk) on Jun 06, 2010 at 08:37 UTC
    if (!$istrue)  { print "this is bad"; next }
Re^2: and multiple statements
by JavaFan (Canon) on Jun 06, 2010 at 11:46 UTC
    But an if would be clearer.
    Is it? Always? For everyone?

    Considering the idom open ... or die ... is quite common, I'd say that

    open ... or do {...;...}
    is clearer than
    if (!open ...) { ...; ... }
    I'd certainly write the former.
      It's quite common because it's required in the case of open(my $fh, ...), not because it's clearer.
        Required? I don't follow.
        if (!open my $fh, "<", "filename") { warn "Whatever"; return; }
        is perfectly valid code. There's no requirement that that is to be written as
        open my $fh, "<", "filename" or do {warn "Whatever"; return;};