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