Hello myfamilygeneral, and welcome to the Monastery!
The problem is not with $dirtree_frame->destroy, but with the immediately preceding term \&show_cwd(). Consider the following:
#! perl use strict; use warnings; sub foo { print "in foo()\n"; } sub bar { \&foo(); print "in bar()\n"; } bar();
Output:
Useless use of reference constructor in void context at test.pl line 1 +2. in foo() in bar()
But remove the backslash (which does nothing useful anyway) from before &foo(), and the warning goes away.
Update: The & sigil probably does nothing useful either. See What's the difference between calling a function as &foo and foo()?
HTH,
Athanasius <°(((>< contra mundum
In reply to Re: Useless use of reference constructor in void context
by Athanasius
in thread Useless use of reference constructor in void context
by myfamilygeneral
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |