in reply to text from 2nd file not displaying in scrolledwindow

I can get it to work with a while loop and using a different system command. Which leads me to believe its the way i am formatting the system command. The way I am laing it out in the code.

sub sixad { for my $t ( @file1 ) { if( $t =~ m/No controller found on USB busses./ ) { &warning; return } } if ( $Count gt 0 ) { open my $OutFile2, "+>", "tmp2", or die "Can't open file: $!"; my @sixad = qw(ls >tmp2); my $OutPut2 = system( "@sixad" ); my @file2 = <$OutFile2>; while( <@file2> ) { #for my $n ( @file2 ) { $Pane->insert("end", "$_". "\n"); #return; } close($OutFile2); return; } else { &warning; return; } };

Replies are listed 'Best First'.
Re^2: text from 2nd file not displaying in scrolledwindow
by amboxer21 (Sexton) on Feb 20, 2014 at 02:18 UTC
    This works but only when i hit control + c in the terminal. Which gives control back to the parent window/process.

    sub sixad { for my $t ( @file1 ) { if( $t =~ m/No controller found on USB busses./ ) { &warning; return } } if ( $Count gt 0 ) { open my $OutFile2, "+>", "tmp2", or die "Can't open file: $!"; my @sixad = qq/'\/usr\/bin\/sixad --start 2>tmp2'/; print system qq( '@sixad' ); my @file2 = <$OutFile2>; while( <@file2> ) { $Pane->insert("end", $_); } return; close($OutFile2); } else { &warning; return; } };