[EMAIL PROTECTED] <[EMAIL PROTECTED]> asked: > Any ideas... as the file is not being appended to. The > rights are correct, > 664 and it prints to the STDOUT which is my screen???
> open (FOO,">>$fout") || die "could not open file: $fout $!"; > > foreach my $dev (@devs) { > $dev .= "\n"; > system("samcmd a $dev >> $fout"); > select( (select(FOO), $|=1 ) [0] ); } This is broken, at least if it is supposed to do what I think you had in mind - you can't flush somebody else's file for them. If you didn't want that, it's even worse - opening a file for appending while having another process writing to it can only have unpredictable results. Why don't you start first by figuring out how to capture the output from samcmd? If it gets printed on your screen, then you shell code snippet is obviously not doing the right thing. Have you checked to see wether the output goes to STDERR instead? Then you'd need "2>>" instead. In any case, you really should check the return code from system. If you're going to read and parse that file later, it might be even useful to use a pipe open like open( IN, "samcmd a $dev 2>\&1 |" ) or die ... and then start parsing immediately. HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>