On Tue, 6 Sep 2005 16:12:35 +0800, "Jayvee Vibar" <[EMAIL PROTECTED]> said: > How do you name subroutine reference parameter in perl? > Naming a local or pass by value is by simply using my ($param1, $param2) > = > @_ ; > How about by reference? I think it would be harder if I'll be using > $_[0], > $_[1] direct method. > Is it possible? > > Thanks. >
Passing reference as parameter to subroutine is as easy as the normal way.And,if u pass some types of parameter such as hash,array,or handle to subroutine,using reference instead is more safer. for example,such below code is right: my (%hash,@array); &sub_test(\%hash,[EMAIL PROTECTED]); sub sub_test{ my ($hash_ref,$array_ref)[EMAIL PROTECTED]; my %hash=%$hash_ref; my @[EMAIL PROTECTED]; do something... } -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - IMAP accessible web-mail -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>