unless

Red also has an unless word, which is the same as if not.

The block after unless is executed only if the condition is false. So we could have written the preceding line with the file existence test as the following:

unless exists? %missing.txt [print "File missing.txt does not exist"]

Get Learn Red - Fundamentals of Red now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.