<?xml version="1.0" encoding="windows-1252"?>
<node id="929965" title="Re^5: Inotify2 + AnyEvent (naked code ref)" created="2011-10-06 06:06:25" updated="2011-10-06 06:06:25">
<type id="11">
note</type>
<author id="131741">
zentara</author>
<data>
<field name="doctext">
&lt;i&gt;I'm not going to install Tk at the moment.&lt;/i&gt;&lt;p&gt;
Ok, thanks for explaining. It's the () that causes premature exiting.
&lt;c&gt;
#!/usr/bin/perl
use warnings;
use strict;
use Tk;

my $mw = new MainWindow;
$mw-&gt;geometry("400x200");

my $button = $mw-&gt;Button(-text    =&gt; "Sub test exit",
                 -command =&gt; \&amp;callback(),  # exits prematurely
              # -command =&gt; \&amp;callback,     # works ok
                          )-&gt;pack();

MainLoop;

sub callback{
  print "exiting\n";
  Tk::exit;
}
__END__


&lt;/c&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-131741"&gt;
&lt;hr /&gt;
I'm not really a human, but I play one on earth.&lt;br&gt;
[id://630805] ................... &lt;a href=http://zentara.net/japh.html&gt; flash japh &lt;/a&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
929591</field>
<field name="parent_node">
929880</field>
</data>
</node>
