Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

$IN->param ('') -- simple question please help!

Quote Reply
$IN->param ('') -- simple question please help!
is it possible loop through $IN->param('')?

For example, in the main sub of admin.cgi you find:

Code:
sub main {
# ------------------------------------------------------------------
# Main admin loop, displays html pages and other admin tasks.
#
if (! $CFG->{setup}) {
$IN->param('do', 'page');
$IN->param('page', 'setup_first.html');
}
my $do = $IN->param('do') || '';
my $action = $IN->param('action') || '';

# Default to home page.
unless ($do or $action) {
if ($IN->param('page')) {
$do = 'page';
}
else {
$IN->param('page', 'home.html');
$do = 'page';
}
}


Where the variable $IN contains params. Can I loop though all of the params and print them out? What the heck is $IN anyway? Please help -- this seemingly simple task would really help me out.

Thanks,
Mike
Quote Reply
Re: [Swaylock] $IN->param ('') -- simple question please help! In reply to
$IN is a GT::CGI object, and you can loop through it as follows:
Code:
my $in = $IN->get_hash;
for (keys %$in) {
print "$_: $in->{$_}";
}

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] $IN->param ('') -- simple question please help! In reply to
Yogi,

Thankyou!!! This is the key I needed.

Mike