On Fri, 24 Dec 2004 12:06:00 +0530, Mallik wrote: > total 6 > drwxr-xr-x 2 mkodiche cisco 96 Dec 23 21:54 . > drwxr-xr-x 4 mkodiche cisco 1024 Dec 23 19:36 .. > -rw-r--r-- 1 mkodiche cisco 0 Dec 23 22:34 a.txt > -rwxrwxr-x 1 mkodiche cisco 279 Dec 23 22:00 background.pl > -rwxrwxr-x 1 mkodiche cisco 92 Dec 23 21:53 loop.pl > ===============================Before system > call=========================== > > ===========================After System Call============================ > > As seen above, the system call output is displayed first and then the > print statement. Malik,
Perl uses a buffer for its print jobs. You might want to turn on autoflush before you execute the system call. Another solution is to save the output of a system call to a variable by quoting it with left quotes (`). Here is a description of autoflush and how to enable it: autoflush HANDLE EXPR $OUTPUT_AUTOFLUSH $| If set to nonzero, forces a flush right away and after every write or print on the currently selected output channel. Default is 0 (regardless of whether the channel is really buffered by the system or not; "$|" tells you only whether you've asked Perl explicitly to flush after each write). STDOUT will typically be line buffered if output is to the terminal and block buffered otherwise. Setting this variable is useful primarily when you are outputting to a pipe or socket, such as when you are running a Perl program under rsh and want to see the output as it's happening. This has no effect on input buffering. See the getc entry in the perlfunc manpage for that. (Mnemonic: when you want your pipes to be piping hot.) thanks /oliver/ -- "If you believe everything you read, you better not read." -Japanese Proverb -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>