Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does this do ??

Status
Not open for further replies.

bluegroper

Technical User
Dec 12, 2002
407
AU
$|++;

What does this instruction do in perl ?
I tried Mr Google, but its useless.
TIA's
 
It's one of Perl's global variables. Have a look in "perlvar".
 
It basically tells perl to print output after every print command instead of waiting to the end of the program. All of perls predefinded variables are explained in perlvar as ishnid said, you can google for that or read it on your local PC if you have perl installed.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Many thx.
I hadn't realised that its a perlvar.
Cheers too.

$|
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 actually buffered by the system or not; $| tells you only whether you've asked Perl explicitly to flush after each write). Note that 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, such as when you are running a Perl script under rsh and want to see the output as it's happening. This has no effect on input buffering. (Mnemonic: when you want your pipes to be piping hot.)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top