in reply to How to check CGI params in if/elsif

Greetings,

If you mean you have a vector of domain names stuffed in a directory, you can (lazily) do something like:

my $siteid=$q->param('siteid'); if(!$siteid) { #complain } elsif(grep {$siteid eq $_} @directory) { # taken } else { mkdir 0755 $siteid or warn("Foo: $!") push @directory, $siteid; # or whatever }
Where I cached $siteid to avoid a function call per comparison in the grep block.

Cheers,
alf


You can't have everything: where would you put it?