Seems like a bug, or at least as an unintended use . Will try to fix, watch github for changes. Meanwhile, would that help you?
#!/usr/bin/perl --
use strict;
use warnings;
Main( @ARGV );
exit( 0 );
sub Main {
ShowPrima();
ShowPrima();
}
sub ShowPrima {
require Prima ;
require Prima::Buttons;
require Prima::Application;
$::application ||= Prima::Application-> create( qw' name Prima ');
+
my $mw = Prima::MainWindow->create(
text => 'Hello world!',
size => [ 200, 200],
);
$mw-> insert( Button =>
centered => 1,
text => 'Hello world!',
onClick => sub { $mw-> cancel },
);
$mw-> execute;
}