Do you know where your variables are? | |
PerlMonks |
Re: New to Programming and I have chose PERLby TStanley (Canon) |
on Jan 12, 2005 at 04:00 UTC ( [id://421492]=note: print w/replies, xml ) | Need Help?? |
Welcome to PerlMonks! Here is how I would have done your code: By using strict, you will catch accidental misspellings and make you declare your variables. The way that your code is right now, you don't see the last line of it,until you do a control-C out of the program. Mine will do one of the calculations then exit. When checking the input with a regular expression, I used the "i" modifier which means that if the user has their caps lock key on, it will still accept it. TStanley -------- The only thing necessary for the triumph of evil is for good men to do nothing -- Edmund Burke
In Section
Seekers of Perl Wisdom
|
|