handle void return, move to pure xs
[p5sagit/Devel-BeginLift.git] / lib / Devel / BeginLift.pm
CommitLineData
0395308e 1package Devel::BeginLift;
2
3use strict;
4use warnings;
1594b447 5use 5.008001;
0395308e 6
1594b447 7our $VERSION = 0.01;
0395308e 8
1594b447 9use vars qw(%lift);
10use base qw(DynaLoader);
0395308e 11
1594b447 12bootstrap Devel::BeginLift;
0395308e 13
14sub import {
15 my ($class, @args) = @_;
16 my $target = caller;
17 $class->setup_for($target => \@args);
18}
19
20sub unimport {
21 my ($class) = @_;
22 my $target = caller;
23 $class->teardown_for($target);
24}
25
26sub setup_for {
27 my ($class, $target, $args) = @_;
28 setup();
29 $lift{$target}{$_} = 1 for @$args;
30}
31
32sub teardown_for {
33 my ($class, $target) = @_;
34 delete $lift{$target};
35 teardown();
36}
37
381;