in reply to multiple commands before unless ?

You have a precedence issue.

I recently happened upon an brilliant online tutorial on this subject, but I can't find the URL for the mo (the issue is nevertheless well addressed in chapter 2 of Simon Cozens' Beginning Perl available online at http://learn.perl.org/library/beginning_perl/3145_Chap02.pdf).

The precedence issue was indeed (very succinctly) pointed out in fglock's reply above.

Removing punctuation, and simplifying, your key line is: print "Program Error!" && exit(0) unless $case; Just change the && to and, and it'll work:

my $case = 1; print 'Program Error' and exit(0) unless $case; print 'No problemo!'
hth dave

Replies are listed 'Best First'.
Re: Re: multiple commands before unless ?
by jsprat (Curate) on Jun 26, 2003 at 16:59 UTC
    Is this the tutorial you were looking for?
      Yep, thanks. I should have known. MJD rules OK.
Re: Re: multiple commands before unless ?
by emilford (Friar) on Jun 26, 2003 at 16:17 UTC
    It's amazing how precedence can throw you off like that. This reminds me of an error I had back in college. You'd think I'd have remembered to take this into consideration in this case. Thanks.