You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Wes Cravens <we...@cortex-it.com> on 2003/06/26 15:24:46 UTC

$apr->param question

I am trying to roll my own parameter collection routines...

I am trying this:

	#Parse / Collect the parameters.
	my %params;
	foreach ($apr->param)
	{
		if (ref($apr->param($_)) eq "ARRAY")


			$params{$_} = [$apr->param($_)];
		}
		else
		{
			$params{$_} = $apr->param($_);
		}
	}

the ref always seems to come out UNDEF but if I take out that logic and
just use

$params($_) = [$apr->param($_)];

Then it is a ref and can be used in a

foreach (@{$params($key)}) { }

as expected.

Any ideas where my understanding is going wrong?

Confused,

Wes