Afternoon all, I want to change some repetitive code so its more dynamic,
basiaclly I want to replace the elsif statements below with one statement
which gets the number dynamically so I only need one if statement.
Any ideas?
Something like this:
elsif ($q-param('delete_aoc1.x')){
On 2/27/06, Graeme McLaren [EMAIL PROTECTED] wrote:
elsif ($q-param(delete_aoc$number.x)){
return Delete AOC $number;
You could do this sort of thing in a loop, such as a 'foreach' loop.
Have you tried writing it that way? Of course, you still have to call
the 'param' method once each
On 2/27/06, Graeme McLaren [EMAIL PROTECTED] wrote:
Afternoon all, I want to change some repetitive code so its more dynamic,
basiaclly I want to replace the elsif statements below with one statement
which gets the number dynamically so I only need one if statement.
Any ideas?
snip
A lot
elsif ($q-param(delete_aoc$number.x)){
return Delete AOC $number;
}
I'm not so sure,is it right for you?
elsif ($q-param(eval delete_aoc$number.x)){
return Delete AOC $number;
}
I just tested under my environment,it could work.
--
Jeff Pang
NetEase AntiSpam Team
Jeff Pang wrote:
elsif ($q-param(delete_aoc$number.x)){
return Delete AOC $number;
}
I'm not so sure,is it right for you?
elsif ($q-param(eval delete_aoc$number.x)){
eval() runs _Perl_ code. delete_aoc$number.x is NOT Perl code so you
shouldn't use eval() on it.