foreach ( @array ) { /linux/ && do { print "This is a linux VM.\n"; next; }; /Windows/ && do { print "This is a Windows VM.\n"; next; }; /Other/ && do { print "I have no idea what it is.\n"; next; }; die "You shouldn't be seeing this: No pattern matched.\n"; }