On Tuesday, June 18, 2002, at 10:52 , Kipp, James wrote:
> well done. but as you said the "form is way ugly". I have adjusted the sub
> to return array refs that i can easily deal with.
>> On Tuesday, June 18, 2002, at 09:40 , Kipp, James wrote:
>>
>>> $totals = [
>>> [ 15.8, 17.2 ],
>>> [ 3.7, 3.9 ],
>>> ....etc....
>>> ];
>>
I bumped my head into the problem because i had originally
coded up the fix in the form
my @totals = [
[ 15.8, 17.2 ],
[ 3.7, 3.9 ],
....etc....
];
return(..., \@totals....);
and noticed that the simplest solution was if I fixed that
to be
my @totals = (
[ 15.8, 17.2 ],
[ 3.7, 3.9 ],
....etc....
);
return(..., \@totals....);
There is also the 'issue' in this gets_stuff() function
that you seem to be on the rightish track of passing
back the reference to the array - vice the usual horror
of trying to return say
return(@list1, @list_shurgged, @lost_list_too)l
and noticing that your
my (@this, @that, @theNextThing) = get_stuff();
put it all in @this....
You might want to think of a hash thing keying on User,
so that you can quickly get at the user's foo with
my $returnedStuff = get_stuff()
if ( exists $returnedStuff->{$username} ) {
# we know that we have that line of data
}else{
# whine that $username not be in our stuff
}
>> then you can unwarp it with say:
>>
>> http://www.wetware.com/drieux/pbl/Auslanders/gets_stats.txt
ciao
drieux
---
"Truth may not always be Beautiful,
but Ugly be a sign of a design Feature with Fangs
about to byte you where it counts...."
- Uncle Drieux's Kritikal Maxims for Software Design
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]