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

use base 'Exporter';

use vars qw{$VERSION};
BEGIN {
	$VERSION = '1.224';
}

@EXPORT_OK = qw( check_with );

sub check_with {
    my ( $code, $checker ) = @_;
    my $Document = PPI::Document->new( \$code );
    is( PPI::Document->errstr, undef ) if PPI::Document->errstr;
    local $_ = $Document;
    $checker->();
}

1;