in reply to cheesy comparison program not working!!

A quick look at your code tells me that you should change
@greater[n] = $_ ;
into
$greater[n] = $_ ;
Thats how you access array elements.
Furthermore, the reason that push doesn't do what you want is because there a \n after each number. Put
chop ;
in the for-loop to remove it, and push will work as you want!!

LuCa

Replies are listed 'Best First'.
Re^2: cheesy comparison program not working!!
by navinjathan (Initiate) on Sep 28, 2007 at 12:37 UTC
    "chomp" !! how can i miss it?!

    I am refering "Learning Perl, 4th Edition".. not surprisingly, the author mentions.. "Every week or two a message appears on the newsgroup comp.lang.perl.misc with a subject-line like this. Without reading the message, we know the program used double quotes around an array containing unchomped strings" !!! LOL

    Stupid me!!