changma_ha has asked for the wisdom of the Perl Monks concerning the following question:
I have a doubt regarding the return value. suppose i have a perl module in which i have define a method for hash. suppose i have a package mymodule.pm in which i have a method like
sub ahash{ my %hash=@_; foreach my $key(keys %hash){ my @ke = keys %hash; my @val = values %hash; return @ke; return @val; } }
And i am calling it like
my @list =qw (1 2 3 4 5); print addmodule::ahash(@list),"\n";
Now my question is can i retun more than 1 value when i defining the mothod ?like i have done in return @ke and return @val...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: return more than 1 value
by roboticus (Chancellor) on Jul 29, 2010 at 06:43 UTC | |
Re: return more than 1 value
by Ratazong (Monsignor) on Jul 29, 2010 at 06:43 UTC | |
Re: return more than 1 value
by Utilitarian (Vicar) on Jul 29, 2010 at 08:38 UTC | |
by changma_ha (Sexton) on Jul 30, 2010 at 06:06 UTC | |
by Utilitarian (Vicar) on Jul 30, 2010 at 07:16 UTC | |
by changma_ha (Sexton) on Jul 29, 2010 at 08:59 UTC | |
|
Back to
Seekers of Perl Wisdom