Hi,


>
>$returnValue=&StudentInfo::updateStudent($conn,%addNewStudentHash,$classsId,$schoolName);
>.......................
>

Generally passing a hash to a subroutine is not good.
You may try to pass a hash's reference to the subroutine,this get things more 
clear.
Just do:

&StudentInfo::updateStudent($conn,\%addNewStudentHash,$classsId,$schoolName);

Here \%addNewStudentHash is the reference for hash %addNewStudentHash.
(why need to pass a reference instead of a hash?because a reference is a 
scalar,while a hash appear as a list.You don't know the hash list's length,so 
you can't control the arguments' order exactly.)


>
>Function
>
>sub updateStudent{
>my ($conn,$addNewStudentHash,$classsId,$schoolName)[EMAIL PROTECTED];
>

Ok here in the subroutine you receive the hash's reference.do:

my ($conn,$addNewStudentHash_ref,$classsID,$schoolName) = @_;
my %addNewStudentHash = %$addNewStudentHash_ref; # re-access the original hash


Hope this helps.

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


Reply via email to