replacing multiple elsif statements question

2006-02-27 Thread Graeme McLaren
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')){

Re: replacing multiple elsif statements question

2006-02-27 Thread Tom Phoenix
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

Re: replacing multiple elsif statements question

2006-02-27 Thread Chas Owens
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

Re: replacing multiple elsif statements question

2006-02-27 Thread Jeff Pang
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

Re: replacing multiple elsif statements question

2006-02-27 Thread John W. Krahn
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.