in reply to user input behavior from within a subroutine

With the brackets fixed I get the expected results in perl 5.8.7 and 5.6.1, with no need for a ctl-Z. Here's the test code I used, with the bracket corrected.
my @attributes = qw(first second third); attrib_type(); sub attrib_type { foreach $value (@attributes){ print "Is $value an attribute (y or n)? "; $response = <STDIN>; chomp($response); if ($response =~ "y" || $response =~ "Y"){ print "response is $response\n"; print "configure as an attribute\n"; } else { print "response is $response\n"; print "configure as a parser\n"; } } }

Replies are listed 'Best First'.
Re^2: user input behavior from within a subroutine
by bw (Novice) on Aug 02, 2006 at 18:03 UTC
    Yes, I've also been able to successfully reproduce your success with this code on my machine. By doing a straight cut-and-replace with your code, I still get my annoying behavior. I expect that I have a misplaced bracket elsewhere. So far nothing looks out of place.

    I hesitate to place the entire code as it is rather inelegant to say the least ...