Good Example on $|


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Good Example on $|
# 1  
Old 12-30-2013
Good Example on $|

I am trying to learn how to use the predefined var. I did read perlvar - perldoc.perl.org but like much of the perl docs, I just dont "see" the explanation.

Can someone explain its usage to me. Id like to buffer printing on occasion.

Thanks in advance.
# 2  
Old 12-30-2013
Quick example, don't mind the correctness of the code, just meant as an illustration (using bash):
Code:
while :; do echo $((i++)); sleep 1;done | perl -ne 'print' | while read x ; do echo $x ; done

vs.:
Code:
while :; do echo $((i++)); sleep 1;done | perl -ne '$|=1; print' | while read x ; do echo $x ; done

Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. What is on Your Mind?

What is good?

Hello everyone, I am using centos, 1) solaris is free right? 2) I want to learn solaris and install it in a computer that I am mounting, I would like know what is strong in solaris and if do it is wise. I am programmer python, learning machine and programming in general,..any help thanks,.. (6 Replies)
Discussion started by: gitac
6 Replies

2. IP Networking

What is a good C++ compiler?

i am beginner in tcp programming i know c++ laguage i read i internet that ICE is more powerfull help me please (7 Replies)
Discussion started by: walidfinder
7 Replies

3. Solaris

good OS flavor

which is more in high demand commercial solaris or BSD THANKS (1 Reply)
Discussion started by: mxlst14
1 Replies
Login or Register to Ask a Question