#!/usr/bin/env perl use strict; use warnings; use utf8; use feature "say"; use Math::Trig; &ask; sub ask{ 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"; &ask; } else { my $a = 2*pi; my $c = $a * $radius; say "circumference= ", $c } }
In reply to Re: loop problem
by monsenhor
in thread loop problem
by WisDomSeeKer34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |