myfamilygeneral has asked for the wisdom of the Perl Monks concerning the following question:
Somewhere in Main application call the dirtree_sub below to choose a working area. Once user select the work area through dirtree, it will set the path in $area entry box. But when I add $dirtree_frame->destroy in dirtree_sub below, it print warning:
Useless use of reference constructor in void context at geometry_place +.pl line 564. Useless use of reference constructor in void context at geometry_place +.pl line 570.
Any idea how to solve this?
Some code in main application:
my $area = $mw->Entry(-background => "white", -foreground => "black", +-width => 51)->place(-x=>100, -y=>$ystart + 60); $area->insert('end', "$workarea"); sub dirtree_sub { if ($area->get() ne "") { $CWD = $area->get(); } else { $CWD = Cwd::cwd(); }; my $dirtree_frame = $mw->Toplevel; $dirtree_frame->title("Select work area"); my $DIR_TREE = $dirtree_frame->Scrolled('DirTree', -scrollbars => "osoe", -width => 50, -height => 25, -exportselection => 1, -browsecmd => sub {$CWD = shift}, -command => sub {\&show_cwd(); $dir +tree_frame->destroy})->pack(-fill => "both", -expa +nd => 1); $DIR_TREE->chdir($CWD); my $button_frame = $dirtree_frame->Frame()->pack(-side => "bottom" +); $button_frame->Button(-text => "Ok", -command => sub {\&show_cwd(); $dirtree_fram +e->destroy})->pack(-side => "left"); $button_frame->Button(-text => "Exit", -command => [$dirtree_frame=>'destroy'])->pa +ck(-side => "left"); }; sub show_cwd { $area->delete('0.0', 'end'); $area->insert('end', $CWD); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Useless use of reference constructor in void context
by Athanasius (Archbishop) on Jul 29, 2012 at 15:12 UTC | |
by ww (Archbishop) on Jul 29, 2012 at 16:19 UTC | |
by Anonymous Monk on Apr 11, 2013 at 10:22 UTC | |
|
Re: Useless use of reference constructor in void context
by NetWallah (Canon) on Jul 29, 2012 at 14:33 UTC | |
|
Re: Useless use of reference constructor in void context
by zentara (Cardinal) on Jul 29, 2012 at 15:10 UTC |