I am starting to test a module that uses Moose, after a long time from not doing any moose (not that I did much before). Builder routines are calling named subroutines to show the user a prompt on STDOUT, and they read a response on STDIN.
sub _get_anyStr {
my $prompt = shift;
print "To not give any data, just hit return.\n";
print "$prompt: ";
my $resp = <STDIN>;
chomp( $resp );
return _suckSpaces( $resp );
}
Taking inspiration from an older country and western movie, I entered 'Comments? We don't need no stinking comments.'. I am single stepping perldb in emacs, and what I see is:
"no" not allowed in expression at (eval 226)[/usr/share/perl/5.20/perl
+5db.pl:732] line 2, at end of line
syntax error at (eval 226)[/usr/share/perl/5.20/perl5db.pl:732] line 2
+, near "need no stinking "
I am guessing that it is the token 'need' that is causing problems, but I don't know why. I see things being eval'd a lot while single stepping, is this subroutine running in a big eval? This is about the 5th builder I have stepped through, and none of the others caused any problem. It seems my joke for input tickled something.
What happened? Should I be doing something else? The entire reason for doing this in an old command line fashion, is that I don't seem to get the GUI methods. Thanks.