sirpots has asked for the wisdom of the Perl Monks concerning the following question:
What is going wrong? Sorry I am new to perl!#!/usr/bin/perl use warnings; use strict; use diagnostics; my ($a, $b, $largest, $smallest); print "Enter your First Number:\n" chomp ($a = <>); $largest = $a; $smallest = $a; print "Enter your Second Number:\n" chomp ($b = <>); if ($a > $b); { $largest=$a; $smallest=$b; } else { $largest=$b; $smallest=$a; } print "The Biggest number is $largest and the smallest number is $smal +lest\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I Keep getting the error: "my" variable $a masks earlier declaration in same scope at bigsmall.pl line 8 (#1)
by CountZero (Bishop) on Oct 28, 2011 at 21:01 UTC | |
|
Re: I Keep getting the error: "my" variable $a masks earlier declaration in same scope at bigsmall.pl line 8 (#1)
by toolic (Bishop) on Oct 28, 2011 at 20:10 UTC | |
|
Re: I Keep getting the error: "my" variable $a masks earlier declaration in same scope at bigsmall.pl line 8 (#1)
by johnny_carlos (Scribe) on Oct 28, 2011 at 20:26 UTC | |
|
Re: I Keep getting the error: "my" variable $a masks earlier declaration in same scope at bigsmall.pl line 8 (#1)
by Marshall (Canon) on Oct 29, 2011 at 09:47 UTC |