| macro documentation | Contained in the macro distribution. |
macro::filter - macro.pm source filter backend
use macro::filter add => sub{ $_[0] + $_[1] };
Goro Fuji <gfuji(at)cpan.org>.
Copyright (c) 2008-2009, Goro Fuji <gfuji(at)cpan.org>. Some rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| macro documentation | Contained in the macro distribution. |
package macro::filter; use strict; use warnings; BEGIN{ require macro; our @ISA = qw(macro); *VERSION = \$macro::VERSION; } use Filter::Util::Call (); sub import{ my $class = shift; return unless @_; my $self = $class->new(); $self->defmacro(@_); Filter::Util::Call::filter_add($self); return; } sub filter :method{ my($self) = @_; Filter::Util::Call::filter_del(); 1 while Filter::Util::Call::filter_read(); $_ = $self->process( $_, [caller]); return 1; } 1; __END__