in reply to Rountines

This is what I have so far
#!usr/bin/perl -w use strict; my @list = (26, 3, 53, 65, 9, 101, 19); @list = sort( @list ); min_str(); max_str(); sub min_str { print "n\"; print "$list[0]\n"; } sub max_str { print "$list[7]\n"; }
Needless to say this has many errors.

Replies are listed 'Best First'.
RE: Re: Rountines
by Adam (Vicar) on Sep 20, 2000 at 02:52 UTC
    Bonus points for using strict.

    Some other things you might not know, you can get the last index generically (not using 7). Do some research, and if you still can't figure it out... I'll tell you. Also, read the man page for sort. It will show you how to sort the way you want.

    Oh, and one other thing. Don't print from within your subroutines... have them return the string, and print the return value:
    print min_str( @strings );