Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: Inotify2 + AnyEvent (naked code ref)

by zentara (Archbishop)
on Oct 06, 2011 at 10:06 UTC ( #929965=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Inotify2 + AnyEvent (naked code ref)
in thread Inotify2 + AnyEvent

I'm not going to install Tk at the moment.

Ok, thanks for explaining. It's the () that causes premature exiting.

#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = new MainWindow; $mw->geometry("400x200"); my $button = $mw->Button(-text => "Sub test exit", -command => \&callback(), # exits prematurely # -command => \&callback, # works ok )->pack(); MainLoop; sub callback{ print "exiting\n"; Tk::exit; } __END__

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re^5: Inotify2 + AnyEvent (naked code ref)
Download Code
Re^6: Inotify2 + AnyEvent (naked code ref)
by Anonymous Monk on Oct 06, 2011 at 10:12 UTC
    $ perl -MO=Deparse -e " $foo = \&bar " $foo = \&bar; -e syntax OK $ perl -MO=Deparse -e " $foo = \&bar() " $foo = \(&bar()); -e syntax OK

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://929965]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-07-29 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (225 votes), past polls