Smart::Comments might meet your needs as stated more closely, but have a look at Log::Log4perl, it's very nice. Among other things, you can change logging level for individual parts of you system, without having to restart the system.
Comment on Re: Module implementing modified comment-style debugging.
I'd also go for Log::Log4perl. As you can see, leaving log statements in production code with logging disabled makes close to no impact on overall performance (it's actually faster in this benchmark :). Using the init_and_watch option, you can tune the log levels while the program is running (as noted by stiller). That is a property I value very much when arriving at a customer site and the system's symptoms are hard to interpret. Simply increase the log level for individual parts of the system, and see how it actually runs.