in reply to perl tk how to clear contents of text widget

The command to delete all text in a Tk::Text widget is
$text->delete("1.0", 'end');
your command
-command => [$right_frame => \&clear_file])->pack(-side => "bottom")
makes no sense. A Scrolled Text widget dosn't know what => means. Try this
my $Close_help = $left_frame->Button(-text => ' Close Help ', -command => \&clear_file )->pack(-side => "bottom"); sub clear_file { $right_frame->delete('1.0','end'); $right_frame->packForget; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: perl tk how to clear contents of text widget
by john.tm (Scribe) on Jun 29, 2014 at 13:59 UTC
    This still does not clear the text from the text widget.
      It still dosn't clear

      You seem to like to use the array form for the -command. The code I showed you does NOT have the brackets.

      -command => [$right_frame => \&clear_file]) #notice the difference -command => \&clear_file )
      Don't use the bracketed command form unless you know what you are doing with it. It is used if you want to pass arguments to a subroutine, which you don't need in this case.

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh
      Can you prove it? Can you copy/paste your new program?
        i have added the code as suggested. many thanks.