http://www.perlmonks.org?node_id=1216483

WisDomSeeKer34 has asked for the wisdom of the Perl Monks concerning the following question:

The program tries to calculate the circumference of a circle, depending on the input.

#!/usr/bin/env perl use strict; use warnings; use utf8; use feature "say"; use Math::Trig; say "What is the radius?"; my $radius= <STDIN>; chomp ($radius); if ($radius==0) { say "circumference= ", $radius; } elsif ($radius<0) { say "Radius should be greater than 0"; } else { my $a = 2*pi; my $c = $a * $radius; say "circumference= ", $c }

The problem is that if the value is lower than zero, the program stops. And I want it to continue till there is a positive answer or zero.

I tried it with a submodule, but I have to switch off the strict command to make it work.

It should be easy of course, but any help is greatly appreciated.