Gossamer Forum
Quote Reply

Can someone tell me how to print out all the values stored in $self. I can print out each one by using the field name-

print $self->{cgi}->{field_name};

but I would like to print out all the key/values stored in each of the following (some I don't know the key name) -

$self->{in} # a GT::CGI object
$self->{cgi} # a hash of current form input
$self->{sql} # a GT::SQL object connected to the database
$self->{glb_cfg} # a hash of global config options
$self->{cfg} # current table options (like view permissions, etc)
$self->{user} # a hash of currently logged in user.

What's the correct code to write to access all the values so I know what is actually available for me to use in my plugin?


Quote Reply
Re: [jai] $self In reply to
You can use:

use Data::Dumper;
print $self->{in}->header;
print "<pre>".Dumper($self)."</pre>";


Quote Reply
Re: [jai] $self In reply to
That's probably not a good idea, especially with $self->{sql}. You should really look at the docs on how to use each object (i.e. look at the GT::SQL::Table docs for methods you can call to manipulate the table).


Gossamer Threads Inc.