#!/usr/bin/env entity
<object>
  <window ondelete="entity:exit">
   <button label="try returning" onclick="try_return"/>
   <button label="try dieing with print" onclick="try_die_print"/>
   <button label="try dieing" onclick="try_die"/>
  </window>
  <data name="test" />
  <perl><![CDATA[


  print "This is a test of the new confess and protection code\n\n";

  my $node = enode("data.test");
  my $broke = enode("data.Test worked if you see this in error messages.");

  if(!$broke)  #this should fail...
  {
    print "Protected $broke\n";
  }

  ## Not protected.
  $broke->attrib ("this" => "that");

  sub try_return
  {
    print "in try_fail\n";
    my $broke = enode("data.this one will fail cleanly") || return;
  }

  sub try_die_print
  {
    print "in try_fail\n";
    my $broke = enode("data.this one will fail cleanly") || die "Test worked.\n";
  }


  sub try_die
  {
    print "in try_fail\n";
    my $broke = enode("data.this one will fail cleanly") || die;
  }

  ]]></perl>
</object>
  
