Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Write Global Results to file

Quote Reply
Write Global Results to file
I have search high and low. I cannot seem to find a solution. Perhaps it is my ignorance. I am trying to write the results of this global to a file

sub {
my $tags = shift;
local $_ = $tags;

my $table = GT::SQL->new('/XXXXXXXXXXXX/web/admin/comm/defs')->table('comm_users');
$table->select_options ('ORDER BY prof_last_name ASC', 'LIMIT 100');
my $sth = $table->select ( { prof_RecieveMail => 'Yes'} );

my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
return { userinfo => \@output };

Currently it is sent to a a html table file where I am viewing from a browser. I would like to have a text file that these results are written to as well. I know that it is currently being sent to the html, but how to I get the golbal to create a text file, which could be clicked on and downloaded by me and other admins?

This way we do not have to select the html table (that is currently being written) and paste it into excel. I would like to have a file in say coma delimited format that can easily be imported to any spreadsheet? Thank in advance!