Lance Murray wrote:
> 
> Hello:

Hello,

> I know I can return multiple scalar values from a subroutine using an array,
> but how do I return multiple arrays, hashes, etc from a subroutine?

You have to return references to arrays and hashes.  This is all
explained in the perlsub document.

perldoc perlsub


> For example, the following snippet...
> 
>      my @ip_addresses = &getIPAddresses;
                          ^
perlsub also explains why you shouldn't use the Perl4 form of calling
subs anymore.  Is there any reason you are not using perl's builtin
networking functions like gethostbyname() and gethostbyaddr()?

perldoc -f gethostbyaddr
perldoc -f gethostbyname


>      my (@hostfile, @no_dname) = &getHostNames(@ip_addresses);
>      print "\nHOSTFILE: ", scalar @hostfile,"\n",@hostfile;
>      print "\nNO_DNAME: ", scalar @no_dname,"\n",@no_dname;


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to