On Mon, Jun 16, 2008 at 5:52 PM, sivasakthi <[EMAIL PROTECTED]> wrote:

>
> if we pass both array and hash to subroutine then how to retrieve  and print
> the values?
>

Hi,

Under this case, you should use references. like:

my @arr = (1,2,3);
my %hash = (1,2,3,4);
mysub([EMAIL PROTECTED],\%hash);

sub mysub {
    my $arr_ref = shift;
    my $hashref = shift;

    print "@$arr_ref";
    print "%{$hashref}";
}

See also:
perldoc perlsub
perldoc perlref

-- 
Jeff Peng - [EMAIL PROTECTED]
Professional Squid supports in China
http://www.ChinaSquid.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to