rse2 has asked for the wisdom of the Perl Monks concerning the following question:
Hello there!
I have a homework job to 1. Write a perl program that 1. ask a user to type 5 numbers. 2. display the numbers in the correct order on the screen.
Its not working out really swell though. So far i got this done
#! /usr/bin/perl print "\nType in 5 numbers.\nnumber1"; $a = <>; print "\nThe second number\n"; $b = <>; print "\nThe third number\n"; $c = <>; print "\nThe fourth number\n"; $d = <>; print "\nThe fifth number\n"; $e = <>; $bin =""; if ($a > $b {$bin = $b; $b = $a; $a = $bin; print "nThis is line 1 $a $b \n";} $a = <>; $b = <>; $c = <>; $d = <>; $e = <>; if ($b > $a) { print "\n This is line 2 $a $b \n";} if ($c > $d) {$bin = $d; $d = $c = $sbin; print "\n $c $d \n";}
I would very much appreciate it if you could point out my mistakes and give me some hints, or tips.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Check this code please?
by Corion (Patriarch) on Aug 06, 2011 at 18:08 UTC | |
|
Re: Check this code please?
by kcott (Archbishop) on Aug 06, 2011 at 21:46 UTC | |
|
Re: Check this code please?
by jethro (Monsignor) on Aug 07, 2011 at 00:44 UTC | |
|
Re: Check this code please?
by TomDLux (Vicar) on Aug 08, 2011 at 17:37 UTC | |
|
Re: Check this code please?
by Anonymous Monk on Aug 09, 2011 at 06:12 UTC | |
by Anonymous Monk on Aug 09, 2011 at 06:20 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |