Colin Johnstone wrote:
Gidday All,
Im trying to pass a hash to a subroutine now. When passing with other variables do I have to pass it as a reference like I do an array. If so how do you dereference it, if you have to at all.
Where am I going wrong?
sub generate_navIndex{
my ( $paramPath, $paramPageName, $paramArrayIndexPages ) = @_;
my %paramArrayPicDetails = @{$paramArrayIndexPages};

are u sure u want to do this ?
u are assigning an array to a hash , that is valid in perl , but I dont see any sense here.
my $output = "";
while( my ( $key, $value ) = each( %paramArrayIndexPages ) ){
$output .= "$key<br>";
}
return $output;
}
my $htmloutput = generate_navIndex( $outputDir, $pageName, \@arrayIndexPages );
                                                             ^^^^^

just review your code should it be \@arrayIndexPages or \%arrayIndexPages




Any help appreciated.
Try posting more ( and relevant ) code we will be glad to help, thats what usenet is for



Thank YouColin Johnstone Website Project Officer Corporate Website Unit Public Affairs Directorate ph 9561 8643
Ram


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to