jonagondos has asked for the wisdom of the Perl Monks concerning the following question:
why doesn't this piece code run correctly at runtime i probably dont understand the small arrow ->? compile error during runtime is Scalar::Util::looks_like_number(sv) at test.pl line 16, <STDIN> line 1.
if ($numeral = Scalar::Util->looks_like_number($user_radius)) { full code#!/usr/bin/perl use warnings; use Scalar::Util; $radius_times = 2; $radius_times_2 = 3.141592654; $radius_times_2 *= $radius_times; while (1) { print "enter the radius\n"; $user_radius = <STDIN>; chomp($user_radius); if (my $numeral = Scalar::Util->looks_like_number($user_radius)) { $user_radius *= $radius_times_2; print "circumference is equal to $user_radius\n"; } else { print "no user input\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: runtime problem
by toolic (Bishop) on Nov 14, 2012 at 17:27 UTC | |
Re: runtime problem
by tobyink (Canon) on Nov 14, 2012 at 18:36 UTC | |
by ColonelPanic (Friar) on Nov 15, 2012 at 10:29 UTC | |
by jonagondos (Novice) on Nov 14, 2012 at 20:00 UTC |
Back to
Seekers of Perl Wisdom