Re: Perl or Bash error?

2004-02-25 Thread John W. Krahn
Rob Dixon wrote:
> 
> You may want to play with the cryptic internal variable $|, but
> I prefer:
> 
>   use strict;
>   use warnings;
> 
>   use IO::Handle;
> 
>   autoflush STDOUT;
>   autoflush STDERR;

Kind of redundant for STDERR.  :-)


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Perl or Bash error?

2004-02-25 Thread juman
Thanks for the tips... they solved my problems...

/juman

On Wed, Feb 25, 2004 at 02:56:48PM +0100, juman wrote:
> I'm trying to make perl print out some status info while doing other
> things but the actual text isn't shown until a newline character is
> passes.
> 
> print "Before";
> sleep (5);
> print "After\n";
> 
> This test will print "BeforeAfter" after 5 seconds sleep? How do I make
> it print "Before" sleep 5 seconds and then print "After"?
> 
> Don't know if this has to do with Perl or the Bash shell I'm using
> though...
> 
> Cheers,
> 
> juman
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Perl or Bash error?

2004-02-25 Thread Rob Dixon
Juman wrote:
>
> I'm trying to make perl print out some status info while doing other
> things but the actual text isn't shown until a newline character is
> passes.
>
> print "Before";
> sleep (5);
> print "After\n";
>
> This test will print "BeforeAfter" after 5 seconds sleep? How do I make
> it print "Before" sleep 5 seconds and then print "After"?
>
> Don't know if this has to do with Perl or the Bash shell I'm using
> though...

Yep. Morbus is right (although I doubt it's his real name :)

You may want to play with the cryptic internal variable $|, but
I prefer:

  use strict;
  use warnings;

  use IO::Handle;

  autoflush STDOUT;
  autoflush STDERR;

  print 'Before';
  sleep 5;
  print 'After', "\n";


HTH,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Perl or Bash error?

2004-02-25 Thread Morbus Iff
>print "Before";
>sleep (5);
>print "After\n";
You're buffering, I suspect. Add $|=1 to the top of your
script, and read: http://perl.plover.com/FAQs/Buffering.html
--
Morbus Iff ( i put the demon back in codemonkey )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Perl or Bash error?

2004-02-25 Thread juman
I'm trying to make perl print out some status info while doing other
things but the actual text isn't shown until a newline character is
passes.

print "Before";
sleep (5);
print "After\n";

This test will print "BeforeAfter" after 5 seconds sleep? How do I make
it print "Before" sleep 5 seconds and then print "After"?

Don't know if this has to do with Perl or the Bash shell I'm using
though...

Cheers,

juman

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]