Wow! I might just try these two for kicks, tho as nobody likely to inherit
this from me is likely to be a Perl hand, I think I'll probably KISS for
now.
I don't necessarily disagree about '' vs qq{}. It's just that the rest of
the code is styled with qq{}, and I thought it better to keep that going.
Tx & rgds, GStC.
-----Original Message-----
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 18, 2005 7:26 PM
To: [email protected]
Subject: Re: Neat Trick
<snip/>
How about:
my %action = (
Submit1 => 'serial',
Submit2 => 'order',
Submit3 => 'sql',
Submit4 => 'user',
);
...
my ($request) = grep {defined $formData->param($_) and $action{$_}} keys
%action; $request ||= 'Unknown';
or
my ($request) = map $action{$_}, (grep (defined($formData-
>param($_)), keys %action;
$request ||= 'Unknown';
I also think that your code would be more readable if you used ''
instead of q{}.
Jenda
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>