On Thu, Jan 10, 2002 at 06:54:25PM +0000, Prahlad Vaidyanathan wrote: > <code> > open(FD,"sudo less /var/log/messages |") ; > print "test\n" ; > my $line = <FD> ; > print "$line\n" ; > print "test #2\n" ; > </code> > > $ ./test.pl > Password:test > [waits for password here] > Jan 6 06:51:13 marvin syslogd 1.4-0: restart. > > test #2 > </output> > > As you can see, it runs 'sudo' _after_ printing "test\n". ie. when it > reads from the file. Um, how do you figure? The sudo program prints out the "Password:" prompt, and from your output you can clearly see "test" is after "Password:". So sudo is being run before "test" is printed. Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com --Thread Previous | Thread Next