Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984286]
[Corion]: No, or I don't remember the story ;)
LanX my favourite don't tell me the proof of concept is good enough for production anecdote
[ambrus]: ah, it's one of thos
[Eily]: what, there's a difference between proof of concept and production?
[LanX]: 20 years ago traders were complaining about the latency of the trading system...
[ambrus]: I'm currently in the process of rewriting my proof of concept programs. They sort of developped organically as I was experimenting, so now I've got an ugly mess of multiple programs and one-liners held together by nothing. I'll have to rewrite them to som
[ambrus]: ething that's both cleanly organized and mostly automated.
LanX in train, bad connection
[Corion]: ambrus: Yeah - we're in that situation too, except that there is no time to do the reorganizing :-/

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (15)
As of 2017-03-29 11:47 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (350 votes). Check out past polls.