Thanks again Marshall - the piece of the code is included below. In the meantime I am trying to figure this out as well...
sub copy_project { # first check for null for Project Name # bail out if Project Name is null if ( !defined $open_source_project_file ) { print "Select Source Project file (.cpm)\n"; exit(); } # check to ensure that project location # is selected by user if ( !defined $destination_project_loc ) { print "Destination project location not specified!\n"; exit(); } # check to ensure that destination project # folder is specified by user if ( !defined $destination_proj_folder ) { print "Destination Project Folder not specified!\n"; exit(); } else { # check for spaces in project name &check_destination_folder_for_spaces; # check to ensure underscore in project name &check_destination_for_underscores; } # check to ensure that directory by the # name of Project Name does not already # exist at Project Location # Following three cases to be considered: # 1. Directory exists but is empty # 2. Directory exists, and not empty, bail out, and ask user for new p +roject name # 3. Directory does not exist if ( -d $destination_project_loc . "/" . $destination_proj_folder +) { # check to ensure this dir. is empty opendir( DIRH, $destination_project_loc . "/" . $destination_proj_folder +); my @dest_proj_folder_files = grep { $_ ne '.' and $_ ne '..' } readdir(DIRH); closedir(DIRH); if (@dest_proj_folder_files) { my $project_dir_exists_error = $mw->messageBox( -title => "Error in Project Name", -message => 'Project Name directory exists, and is non + empty!', -type => 'RetryCancel', -icon => 'error', ); if ( $project_dir_exists_error eq "Retry" ) { &initialize_all_variables; } else { exit(); } } else { # Project Name directory exists but is empty my $final_copy_project_command = &create_copy_project_comm +and; # get rid of top_frame $top_frame->packForget(); # create and display text widget my $tw = $second_frame->Text()->pack(); my $first_line = "Copying project...please wait"; $tw->insert( 'end', $first_line ); my @read_copy_project_command_output = `$final_copy_project_command`; foreach my $output_line (@read_copy_project_command_output +) { $tw->insert( 'end', $output_line ); } } } else { # Project Name directory does not exist # get rid of top_frame $top_frame->packForget(); # create and display text widget #my $tw = $second_frame->Text()->pack(); my $tw = $second_frame->Scrolled("Text")->pack(); my $first_line = "Copying project...please wait\n"; $tw->insert( 'end', $first_line ); my $final_copy_project_command = &create_copy_project_command; #open(COPY_PROJ, "$final_copy_project_command|"); open( COPY_PROJ, '-|', "$final_copy_project_command" ); my $copy_proj_line; while ( defined( $copy_proj_line = <COPY_PROJ> ) ) { $tw->insert( 'end', $copy_proj_line ); $tw->update(); $tw->see('end'); } } } # This sub is called by copy_project sub create_copy_project_command { # prepare copy_project_command # location of destination project depends on # whether same name project dir exists or not my $location_destination_proj; if ( -d $destination_project_loc . "/" . $destination_proj_folder +) { $location_destination_proj = $destination_project_loc; } elsif ( !-d $destination_project_loc . "/" . $destination_proj_fol +der ) { $location_destination_proj = $destination_project_loc . "/" . $destination_proj_folder; } # new project name is derived from what # the user types in Project Name text box my $new_project_name = $destination_proj_folder; my $new_project_file_name = $new_project_name . "\.cpm"; my $new_design_library_name = $new_project_name . "_lib"; # Design name is same as project name my $new_design_name = $new_project_name; my $license = "Concept_HDL_expert"; my $copy_project_command = "copyproject -proj " . "\"" . $open_source_project_file . "\"" . " \-copytopath " . "\"" . $location_destination_proj . "\"" . " \-newprojname " . "\"" . $new_project_file_name . "\"" . " \-newlib " . "\"" . $new_design_library_name . "\"" . " \-newdesign " . "\"" . $new_design_name . "\"" . " \-product " . "\"" . $license . "\""; return $copy_project_command; }

In reply to Re^4: how to display output of a process in text widget in real time by perlnu
in thread how to display output of a process in text widget in real time by perlnu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.