in reply to Variable Variables

I always do something like this when using CGI.pm:
foreach ($query->param) {
	$$_ = $query->param($_);
}
Saves plenty of typing ;) Of course, you could always just select a few variables to use:
foreach (qw(alpha bravo charlie)) {
	$$_ = $query->param($_);
}
Which gives you $alpha, $bravo and $charlie with the values returned from the form. HTH :-)

Replies are listed 'Best First'.
Re: Re: Variable Variables
by xorl (Deacon) on Sep 24, 2001 at 22:48 UTC
    When I try this using mod_perl I'm told: Can't use string ("some_variable") as a SCALAR ref while "strict refs" in use. Is there another way to do this in mod_perl? Thanks