in reply to struggling with sub-routines

you are referencing an array inside your subroutine, but you are not actually passing it an array, you are passing it a scalar ($first). it looks as if you may have intended for @array to be a global, but then you assigned to it inside the subroutine.

Replies are listed 'Best First'.
Re: Re: struggling with sub-routines
by Anonymous Monk on Jun 18, 2002 at 14:10 UTC
    I have taken out the $array = @_; and have also changed the return but it still doesn't work?????