/edit?items=[(\w+)];location=(\w+);flags={(\d+)};...
{
if ( $arg->{location} eq 'US' ) {
for my $item ( @{$arg->{items}} ) {
if ( $arg->{flags}{54} ) {
$r->print "item: $item qualifies for discount 54 processing
\n";
}
}
}
# other optional args that we may / may not have
if ( defined $arg->{style} ) {
$r->print("you have style! $arg->{style}
\n"
}
};
# args are placed in hashref $arg
# [] indicates that the named arg should be an array.
# {} indicates that the named arg should be a hash.
# for a URL of flags=54&flags=23&flags=red
# might yeild
# $arg->{flags} = {
# 54 => 54,
# 23 => 23,
# red => 'red',
# };
# so that programmers can use keys values as they are comfy?
# optional args (ie the ...) are available in $arg