[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: good perl list?



Aaron Turner wrote:

> Unless of course someone here knows how to create a sub with a hash and
> scalar as arguments:
> 
> $return = &sub_command(%hash, $scalar);

References!!!

$return = &sub_command(\%hash, $scalar);

sub sub_command {
	($href, $scalar) = @_;
	%hash = %$href;
	...
	return;
}

That's kinda from my head, but it *should* work...


> that and why:
> 
> foreach my $keys (sort keys %hash) {
>   print "$hash{$keys}";
> }
> 
> generates a bogus result.  Basically I have 3 values for $keys: 0, 1 , 2.
> 
> But I get: '1', '2', '3', ' '.

What the....   more code???


-- 
"But whatever was to my profit I now consider loss for the sake of Christ.
What is more, I consider everything a loss compared to the surpassing
greatness of knowing Christ Jesus my Lord, for whose sake I have lost all
things.  I consider them rubbish, that I may gain Christ." Philippians 3:7-8