# chooses a message to print based on the day of the week entered. while ( <> ) { if ( /Saturday|Sunday/i ) { print "Weekend!\n"; } elsif ( /Monday|Tuesday|Wednesday|Thursday|Friday/i ) { print "This is a workday.\n"; } }
In reply to Pattern Matching #2
by vroom
in thread Pattern Matching Exercises
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |