#!/usr/bin/perl -w

use CORBA::ORBit idl => [ qw(test.idl) ];
use strict;

package Factory;

@Factory::ISA = qw(POA_FooBar::Factory);

use Error qw(:try);

sub new {
  bless {}, shift;
}

sub keepalive { 1 }
sub foobar { 1 }

package main;

my $orb = CORBA::ORB_init('test');
my $poa = $orb->resolve_initial_references('RootPOA');
$poa->_get_the_POAManager->activate;

my $factory = Factory->new($poa);
$poa->activate_object($factory);
open(IOR, '>test.ior');
print IOR $orb->object_to_string($poa->servant_to_reference($factory));
close(IOR);

$orb->run;
