in reply to C/C++ type assert() in Perl?

If you're going to roll your own, may I suggest that you have assert() determine whether or not it's going to do anything? Also, make it an environment variable so you can test it on the command line rather than have to alter the code. You could also do the test in the sub call, but that's going to slow things down every time. Using your example:

use strict; # many lines of code here assert($val < $var1, $message); # many lines of code here sub assert() { return unless $ENV{DEBUG}; my ($result, $message) = @_; die $message unless $result; }

Another method would be to check out Test::AtRuntime.

Cheers,
Ovid

New address of my CGI Course.