S
Steve
Hi all,
I'm wondering what is the best way to performance optimize a conditional
in Perl.
In my particular instance I have:
if (simple_condition and complex_condition) {
do_foo();
};
simple_condition is just a Boolean.
complex_condition is a large regex.
Is the above syntax optimal, or would I be better doing:
if (simple_condition) {
if (complex_condition) {
do_foo();
};
};
There's also the variation of:
if (simple_condition) {
do foo() if complex_condition;
};
I don't see how the above is different from the previous example but
thought I'd mention it just in case.
Steve
I'm wondering what is the best way to performance optimize a conditional
in Perl.
In my particular instance I have:
if (simple_condition and complex_condition) {
do_foo();
};
simple_condition is just a Boolean.
complex_condition is a large regex.
Is the above syntax optimal, or would I be better doing:
if (simple_condition) {
if (complex_condition) {
do_foo();
};
};
There's also the variation of:
if (simple_condition) {
do foo() if complex_condition;
};
I don't see how the above is different from the previous example but
thought I'd mention it just in case.
Steve