in reply to a not so complex if statment
Use procedures. Here's a hypothetic example:
if (defined($max)) { $if = sub { ($Files >= $max) }; } if (defined($min)) { if ($if) { my $oldif = $if; $if = sub { &$oldif() || ($IdleTime >= $min) +}; } else { $if = sub { ($IdleTime >= $min) }; } } # ... # then you invoke it with if (&$if()) { print "hi"; } else { print "hello"; }
And you may want to get a copy of MJD's HOP. I don't really know if it helps here, as I haven't yet got that book, but I think it may.
Update: don't belive what ikegami said above, eval-string is evil.
Update 2: but he's right about the boolean values, of course.
|
|---|