in reply to Returning an array from a sub in a package

Well, first, I think you want the function to be "join_files". But anyway, you can't return an array in scalar context and expect it to be an array -- maybe you want to return a reference to the array, or maybe you want to use the elements in the array as arguments to the new constructor...

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

  • Comment on Re: Returning an array from a sub in a package

Replies are listed 'Best First'.
Re: Re: Returning an array from a sub in a package
by jryan (Vicar) on Aug 24, 2001 at 04:07 UTC
    Yeah, woops, its supposed to be join_files. I was in a hurry. Exactly how would I return the reference?
      You'd do return \@array.

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;