in reply to Problem with simple program reading from STDIN

You can use a following construction which look like switch operator:
#!/usr/bin/perl -w use strict; SWITCH: for(<STDIN>) { /^[Yy]o$/ && { print "whats up"; last; }; /^[Nn]ot much$/ && { print "cool"; last; }; print "HUH?" }

====>
Mice were crying and stinging but went on nibbling the cactus ... 
                                              ( The facts of life )
                                                              <====