my $fp; $fp = Foo::Parse->new('FooParser', sub { local $_ = shift; s/^\w+:// or $fp->warn("something wrong!"); split /,/; } );