in reply to Optimization of a piece of code(Is there a better way than this?)
you can also do $self->_set_Max_Questions(...) to make your code look more object oriented :) Update err, the $self-> thing is assuming you are using OO, based on the $self...if($Max_Questions > $Total_Questions){ croak"Number of questions in $FileName exceeded"; }elsif($Max_Questions < 1){ croak"Must have at least one question in the test."; }else{ &_set_Max_Questions($self,(defined $Max_Questions ? $Max_Questions : + $Total_Questions)); }
Update This is just plain wrong, see post below.
- Ant
- Some of my
best work - (1 2 3)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Optimization of a piece of code(Is there a better way than this?)
by Abigail-II (Bishop) on Jul 04, 2002 at 11:42 UTC | |
by suaveant (Parson) on Jul 08, 2002 at 14:25 UTC |