in reply to Re: Suppressing Warning/Error messages
in thread Suppressing Warning/Error messages

Hi Corion - Thanks for reply. The input i am expecting is definitely Numeric. But what i am trying to achieve here is, if end user happens to choose a BAD choice(which could be anything else but a number), The message displayed should be simply "BAD Choice". I dont need Perl to Err in its way. How can that be achieved ?

  • Comment on Re^2: Suppressing Warning/Error messages

Replies are listed 'Best First'.
Re^3: Suppressing Warning/Error messages
by Corion (Patriarch) on Aug 27, 2015 at 10:32 UTC

    Restructure your if statement as I showed.

    Also, consider reading warnings as it shows how to suppress warnings. But in my opinion, it's much better to structure your code such that it recognizes bad input without raising warnings by, in your example, checking first whether something looks like a number before going on and checking whether it's larger than 22.

      Thanks, working fine as expected !