In this snippet:
The "sub" returns a code-referencesub {\&show_cwd(); $dirtree_frame->destroy})->pack(-fill => "both", -expand => 1 +);
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
In reply to Re: Useless use of reference constructor in void context
by NetWallah
in thread Useless use of reference constructor in void context
by myfamilygeneral
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |