in reply to multiple commands before unless ?

Is it possible to have multiple commands preceeding an unless test?

Use do:

do {print "Program Error!"; exit(0)} unless [case is true];

Although, personally, I would find the prefix variant of unless clearer if you're doing more than one thing.

While I'm at it, I have a short script that replaces a specific line in a file. Is there a better way to do this than what I'll pseudo code below?

Take a look at Tie::File - dead useful :-)

Replies are listed 'Best First'.
Re: Re: unless
by emilford (Friar) on Jun 25, 2003 at 18:24 UTC
    The do{ } is exactly what I needed, however I want to avoid using modules in this case. Tie::File looks handy for other uses, but not what I'm doing at the moment. Anyone else have any other methods that don't require a module?