Sunday, July 10, 2011

sending array as arguments

Perl Script

sub myfunc
{
my @a = @{shift()};
print "@a";
}
package main;
@aa=("hello","aaaaa");
&myfunc (\@aa);

Output:

G:\perl_programs>perl function_sendarray.pl
hello aaaaa
G:\perl_programs>

No comments:

Post a Comment