Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://929965]
[PriNet]: quick question... anyone know how to remove all the existing keys in a %hash ? i've tried several options, but when i re-use the hash, some of the "upper" keys that i don't re-use stick and i can't get them to "remove"

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2017-06-28 02:46 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (619 votes). Check out past polls.