Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Tk::waitVariableX - AUTOLOAD failed

by hdb (Prior)
on Apr 09, 2013 at 15:08 UTC ( #1027762=note: print w/replies, xml ) Need Help??


in reply to Tk::waitVariableX - AUTOLOAD failed

I do not know why, seems strange object interface, but the following seems to work (experimental Perl):

waitVariableX ($mw, 5 * 1000, \$unchanged_var); # sleep 5 secon +ds

Replies are listed 'Best First'.
Re^2: Tk::waitVariableX - AUTOLOAD failed
by jowe (Sexton) on Apr 09, 2013 at 15:32 UTC
    Thanks very much. It solved the problem (dont know why).
    Thanks again - jowe

      The documentation and the code of the module are looking inconsistent. The documentation says:

      $splash->waitVariableX( [$millis, $destroy_splashscreen], \$v1, \$v2} +);

      while in the code

      sub waitVariableX { use Tie::Watch; my ($parent, $millis) = (shift, shift); # @_ has list of var refs

      the arguments have different names (and probably different meaning as well).

        It is the OO Perl. The first argument is the invocant, the second argument is the interval (but according to the documentation, might as well be an array ref). The rest of the parameters are left in @_ to be used later.

        Handling the array ref:

        if (ref $millis eq 'ARRAY') { $callback = Tk::Callback->new($millis->[1]); $millis = $millis->[0]; }

        Handling the remaining variable references:

        foreach my $vref (@_) {
        لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        The module description stems from the 'Mastering Perl/Tk' bible. Both usage formats are described as valid. I choose the more 'simple' one.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027762]
help
Chatterbox?
choroba waits
[thepkd]: $aohoaoh ->{'foo'} has to be dereferenced to access its contents right?
[thepkd]: sorry. i mean $aohoaoh[0]
[GotToBTru]: $aohoaoh is an array reference tho
[thepkd]: some guy was suggesting $aohoaoh[0]->{'foo '}[0]->{}. This wouldnt work.
[GotToBTru]: you're mixing notation there I think
[GotToBTru]: $aohoaoh->[0] is a hash reference, so $aohoaoh->[0]->{ key1} would work
[1nickt]: If 1nickt is the some guy, that's not what he said.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2016-12-06 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (104 votes). Check out past polls.