in reply to Re: Homework: simple calculator
in thread Homework: simple calculator
If people here start about code layout, indentation, and useless constructs, I'd like to throw in one of my pet peeves here.
if (expression) { die "reason"; } else { ... }
is so unnessasary cluttering. A program flow stops after a die. There is no use for an else. Same after a return is a sub
lc $first_number eq "q" and die "Goodbye\n"; ... rest of code
Is so much easier to read and maintain. For those that like statement modifiers (I don't), you can also use
die "Goodbye\n" if lc $first_number eq "q";
|
|---|