summaryrefslogtreecommitdiff
path: root/ext/B/O.pm
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-20 18:05:33 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1998-02-20 18:05:33 +0000
commita798dbf2f5009fe67f7460a594ffd57a76c0fa98 (patch)
treea450591fde794d984b10a254ee5f3dae1533616c /ext/B/O.pm
parenta8581515f26a081f18157dc1cf5553deae632d07 (diff)
downloadperl-a798dbf2f5009fe67f7460a594ffd57a76c0fa98.tar.gz
Move lib/B/... and lib/[BO].pm over to where they should be,
under ext/B. p4raw-id: //depot/perl@564
Diffstat (limited to 'ext/B/O.pm')
-rw-r--r--ext/B/O.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/B/O.pm b/ext/B/O.pm
new file mode 100644
index 0000000000..40d336e122
--- /dev/null
+++ b/ext/B/O.pm
@@ -0,0 +1,21 @@
+package O;
+use B qw(minus_c);
+use Carp;
+
+sub import {
+ my ($class, $backend, @options) = @_;
+ eval "use B::$backend ()";
+ if ($@) {
+ croak "use of backend $backend failed: $@";
+ }
+ my $compilesub = &{"B::${backend}::compile"}(@options);
+ if (ref($compilesub) eq "CODE") {
+ minus_c;
+ eval 'END { &$compilesub() }';
+ } else {
+ die $compilesub;
+ }
+}
+
+1;
+