in reply to Please help...not certain why my code does not work.

One place you're going wrong (and, sorry to be blunt, but there are a *lot* of places where you're going wrong here):

Your openfile subroutine loads all the lines of the file into the @file array, and closes the file. Yet later, when you're trying to sort the data, you're attempting to read from the filehandle you've already closed. Instead, loop over the array that holds the file's contents (you might check out map for this sort of thing).

Another place: check out Perl's built-in sort function, it will save you many a headache. (perlfunc:sort or perldoc -f sort on your own system).

Good luck!

perl -e 'print "How sweet does a rose smell? "; chomp ($n = <STDIN>); +$rose = "smells sweet to degree $n"; *other_name = *rose; print "$oth +er_name\n"'

Replies are listed 'Best First'.
Re: Re: Please help...not certain why my code does not work.
by Satanya (Novice) on Jun 05, 2001 at 00:47 UTC

    no problem... this is the only way I am going to learn.

    I am still really new at this... so all of your help is greatly appreciated.

    Thanks again

    Satanya