Gossamer Forum
Home : Products : DBMan SQL : Discussion :

How to manipulate results in globals

Quote Reply
How to manipulate results in globals
Hello!

I want to change the results array generated by a query in a global and write the changed results back again to the external results variable. I know how to get the results into a global but how can I write the variable back to the external results variable?

Code:


sub {
my $tags = shift;
my $results = $tags->{'results'};



(Now some manipulation of $results)



But how do I write my $results back to the external variable?


Thanks!

Armin
Quote Reply
Re: [Armin] How to manipulate results in globals In reply to
I would guess you should be able to assign to it in the following way:
Code:
$results->[4]{last} = 'Cramwinckel';
push @$results, {first=>'Paul', last=>'Armin'};

Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] How to manipulate results in globals In reply to
Jasper, thanks for your help. I figured out that I can return it as a hash reference in this way:

$tags->{'results'}=\@output;

Armin