Methods::CheckNames - Statically check for named methods


Methods-CheckNames documentation Contained in the Methods-CheckNames distribution.

Index


Code Index:

NAME

Top

Methods::CheckNames - Statically check for named methods

SYNOPSIS

Top

	my Foo $object;

	$object->method(); # dies at compile time unless a method can be found

DESCRIPTION

Top

This module enables simplistic checking of method names for typed my variables.

It's not much more than a proof of concept.

TODO

Top

VERSION CONTROL

Top

This module is maintained using git. You can get the latest version from git://github.com/rafl/methods-checknames.git.

AUTHOR

Top

Yuval Kogman <nothingmuch@woobling.org>

COPYRIGHT

Top


Methods-CheckNames documentation Contained in the Methods-CheckNames distribution.

#!/usr/bin/perl

package Methods::CheckNames;

use strict;
use warnings;
use B::Hooks::OP::Check;
use B::Hooks::OP::PPAddr;
use B::Hooks::EndOfScope;
use namespace::clean;

our $VERSION = "0.06";

eval {
	require XSLoader;
	XSLoader::load(__PACKAGE__, $VERSION);
	1;
} or do {
	require DynaLoader;
	push our @ISA, 'DynaLoader';
	__PACKAGE__->bootstrap($VERSION);
};

sub import {
    my ($class) = @_;
    my $caller = caller;

    my $hook = $class->setup;

    on_scope_end {
        $class->teardown($hook);
    };

    return;
}

__PACKAGE__

__END__