The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Smart::Comments - Comments that come to life

VERSION

This document describes version 0.01 of Smart::Comments, released September 28, 2004.

SYNOPSIS

    use Smart::Comments;
    my $x = 1; my $y = 2;
    sub is_odd { $_[0] % 2 }

    ### require: $x > $y
    ### require: is_odd($y)

    for (my $j=500; $j>0; $j--) {   ### Compiling===[%]  done
        select undef, undef, undef, 0.01;
    }

DESCRIPTION

This module filters your source code, turning any comments beginning with ### into code that interacts with the rest of the program.

To remove this effect, simple remove the use Smart::Comments line, and the original code will run with no speed penalty at all. You may also turn off the filtering lexically, using no Smart::Comments.

Here are some more examples of how this module works:

    while (<>) {                    ### Loading $_
        sleep 1;
    }

    my $i = 10;
    while ($i-- > 0) {              ### Preparing----->
        sleep 1;
    }
    ### i now: $i

    for my $j (1..500) {            ### Compiling===[%]  done
        select undef, undef, undef, 0.01;
    }

    %foo = ( a=>{foo=>'bar'}, b=>[1..5] );
    ### %foo

    for (1..25) {                   ### Loading...  done
        sleep 1;
    }

    ### check: keys(%foo) == 2
    ### require: keys(%foo) == 3

CAVEATS

Currently, there are no meaningful tests and documentation for this module. Contributions will be very much appreciated.

TODO

Fix line numbering problem (i.e. last message in the example above).

Add line numbers to non-progress-bar reports.

AUTHOR

Damian Conway (damian@conway.org)

MAINTAINERS

Autrijus Tang <autrijus@autrijus.org>, Brian Ingerson <INGY@cpan.org>.

COPYRIGHT

   Copyright (c) 2004, Damian Conway. All Rights Reserved.
 This module is free software. It may be used, redistributed
     and/or modified under the same terms as Perl itself.