2muchtime
03-10-2003, 01:48 AM
Hey I m just starting to learn some perl, this may not be a good script, but i am wondering where my errors are, and how I can improve it.
#!usr/bin/perl
$c = 10;
print "\nType something, and be amazed!\n";
$a = <STDIN>;
chomp $a;
print "you typed, \"$a\" WOW!\n";
#9
print "Now let's try something else!\n enter a number between -10 and 10\n";
$b = <STDIN>;
chomp $b;
#14
do
{
for ($c == -10,$c <= 10,$c++);
} while($b != $c);
if ($b != $c)
{
print "You didn't enter a value between -10 and 10! DO SO1\n";
$b = <STDIN>;
}
else
{
print "You entered $b\n";
$b **= 2;
print "When squared that equals $b\n";
print "is that true?\n";
$d = <STDIN>;
if ($d == yes)
{
print "Darn right it is!\n";
}
else
{
print "Liar!\n";
}
}
#!usr/bin/perl
$c = 10;
print "\nType something, and be amazed!\n";
$a = <STDIN>;
chomp $a;
print "you typed, \"$a\" WOW!\n";
#9
print "Now let's try something else!\n enter a number between -10 and 10\n";
$b = <STDIN>;
chomp $b;
#14
do
{
for ($c == -10,$c <= 10,$c++);
} while($b != $c);
if ($b != $c)
{
print "You didn't enter a value between -10 and 10! DO SO1\n";
$b = <STDIN>;
}
else
{
print "You entered $b\n";
$b **= 2;
print "When squared that equals $b\n";
print "is that true?\n";
$d = <STDIN>;
if ($d == yes)
{
print "Darn right it is!\n";
}
else
{
print "Liar!\n";
}
}