Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Useless use of reference constructor in void context

by NetWallah (Abbot)
on Jul 29, 2012 at 14:33 UTC ( #984286=note: print w/replies, xml ) Need Help??


in reply to Useless use of reference constructor in void context

Please use "code" tags to preserve code formatting.

In this snippet:

sub {\&show_cwd(); $dirtree_frame->destroy})->pack(-fill => "both", -expand => 1 +);
The "sub" returns a code-reference
The "->pack" is a dereference followed by a call to the "pack" method.

Since the subref does not de-reference to something that allows a method call, perl complains.

Update 1: Sorry - this is rubbish. I just noticed the "), which means you are calling "pack" on whatever is returned by "$dirtree_frame->Scrolled".

Update 2: New theory :

$dirtree_frame is not created properly.
Evidence is the TWO messages complaining about the object - one for each method call (Scrolled and destroy).
Update 3: Athanasius (++) , below is right. And thanks for fixing the formatting, and Welcome to the Monastery!

             I hope life isn't a big joke, because I don't get it.
                   -SNL

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984286]
help
Chatterbox?
[Discipulus]: congrats choroba!
Discipulus shutdown and logoff seem untrappable by Perl on win. But it is in Cygwin. but i cannot switch to it
[choroba]: It has the widest rear seats space available in the same price category - needed for the 3 kids.
Discipulus families growth is related to price of cars nowadays..
[choroba]: price of anything, unfortunately

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-01-17 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (154 votes). Check out past polls.