On Wednesday, May 1, 2002, at 04:22 , Brett W. McCoy wrote:

> On 1 May 2002, rory oconnor wrote:
>
>> If I were to hard-code these declarations, I would have about 40 lines
>> that look like:
>>
>> $order_id = $session->get_query_value('order_id');
>> $customer_id = $session->get_query_value('order_id');
>> $bill_prefix  = $session->get_query_value('bill_prefix');
>> $bill_fname = $session->get_query_value('bill_fname');
>>
>> The $session-> bit is a function that grabs data of the same name as my
>> fieldnames from an outside sessionfile.
>
> And is there a reason to just not stick it all into a hash?
>
> my %field_values = ();
> foreach $i (@fieldlist) {
>         $field_values{$i} = $session->get_query_value('$i');
>         }
>
> -- Brett

then at the top of the happy Space there is the lister

@fieldlist = qw/
order_id
bill_prefix
bill_fname
/;


which would be a really cool thing - but it also begs the question:

if one is doing this in a 'foreach' loop

why not have a simple

        sub get_query_all_values {

                my %tmpHash =();

                # grovel them all into the hash and just return it....
                %tmpHash;
        }

hence

        %field_of_dreams_value =$session->get_query_all_value();

or is that where the project is going????


ciao
drieux

---


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

Reply via email to