mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > PrimeNet > GPU to 72

Reply
 
Thread Tools
Old 2020-07-30, 15:43   #4929
chris2be8
 
chris2be8's Avatar
 
Sep 2009

35448 Posts
Default

Quote:
Originally Posted by storm5510 View Post
Another item, appearing in (Windows) Strawberry scripts, is $|=1; What this does, I haven't a clue. It appears below the use statements.
From man perlvar (on Linux, but should apply to any OS):
Quote:
HANDLE->autoflush( 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 "getc" in perlfunc for that. See "select" in perlfunc
on how to select the output channel. See also IO::Handle.

Mnemonic: when you want your pipes to be piping hot.
Chris
chris2be8 is offline   Reply With Quote
Old 2020-07-30, 16:53   #4930
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009
U.S.A.

27628 Posts
Default

Quote:
Originally Posted by chris2be8 View Post
From man perlvar (on Linux, but should apply to any OS):

Chris
In my experience with Strawberry (Windows), it "$|=1;" did not work this way. It would hold on to the output until I stopped the script. Then, it would dump to the file. I did it like this:

Quote:
open my $pl,'>>','plist.txt';
$pl->autoflush;
It would do file writes at what appeared to be regular intervals. There has to be differences between Linux Perl and Windows Perl. This is probably one of many.

Last fiddled with by storm5510 on 2020-07-30 at 16:55 Reason: Additional
storm5510 is offline   Reply With Quote
Old 2020-07-30, 17:05   #4931
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

67×139 Posts
Default

Quote:
Originally Posted by storm5510 View Post
There has to be differences between Linux Perl and Windows Perl. This is probably one of many.
Please trust me on this: MANY differences. It's a bit like Java. "Write once, debug everywhere."

Forget about using fork(), unless you're short-running and can simply accept memory leakage. Etc, etc, etc...
chalsall is offline   Reply With Quote
Old 2020-07-30, 17:31   #4932
storm5510
Random Account
 
storm5510's Avatar
 
Aug 2009
U.S.A.

2×761 Posts
Default

Quote:
Originally Posted by chalsall View Post
Please trust me on this: MANY differences. It's a bit like Java. "Write once, debug everywhere."

Forget about using fork(), unless you're short-running and can simply accept memory leakage. Etc, etc, etc...
As I suspected...

I've looked at the spider quite a bit. Most of the code, I cannot grasp. It goes way beyond my Perl skill level. On the surface, it seems too complex, as in trying to do many things. I wonder if all of that is really necessary.
storm5510 is offline   Reply With Quote
Old 2020-07-30, 17:56   #4933
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

67·139 Posts
Default

Quote:
Originally Posted by storm5510 View Post
I've looked at the spider quite a bit. Most of the code, I cannot grasp. It goes way beyond my Perl skill level. On the surface, it seems too complex, as in trying to do many things. I wonder if all of that is really necessary.
LOL... If I may please share...

IMO, Perl has a bad rap along the lines of "Write once, read never". Mostly because of the tight tying of Regular Expressions.

Perl really is the "Internet's Duct-tape". It does Strings in its sleep, and makes gluing software components together trivial.

The learning-curve is perhaps a bit steep, but it's not vertical. And knowing how to use it is very empowering.

Axiom: Always choose the best tool for the job. The more tools you have, the less work you yourself will do.
chalsall is offline   Reply With Quote
Old 2020-07-30, 19:35   #4934
PhilF
 
PhilF's Avatar
 
Feb 2005
Colorado

22×127 Posts
Default

Quote:
Originally Posted by chalsall View Post
Perl really is the "Internet's Duct-tape". It does Strings in its sleep, and makes gluing software components together trivial.
Sounds like you are describing awk:

Perl Awk really is "Internet Unix's Duct-tape". It does Strings in its sleep, and makes gluing software components together trivial.
PhilF is offline   Reply With Quote
Old 2020-07-30, 19:52   #4935
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

100100011000012 Posts
Default

Quote:
Originally Posted by PhilF View Post
Sounds like you are describing awk:
Hey, James and I argue enough about what the P in LAMP should really mean. (And then along came Python, to crash the party (and enforce indentation)...)
chalsall is offline   Reply With Quote
Old 2020-07-30, 19:55   #4936
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

1011110100012 Posts
Default

Quote:
Originally Posted by chalsall View Post
Hey, James and I argue enough about what the P in LAMP should really mean
There's no argument. I was just lurking and keeping myself quietly out of trouble...
James Heinrich is offline   Reply With Quote
Old 2020-07-30, 20:25   #4937
PhilF
 
PhilF's Avatar
 
Feb 2005
Colorado

22·127 Posts
Default

Quote:
Originally Posted by James Heinrich View Post
There's no argument. I was just lurking and keeping myself quietly out of trouble...
Oh Oh... I'm in trouble. I'm a LEMP guy.
PhilF is offline   Reply With Quote
Old 2020-07-30, 20:31   #4938
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

67×139 Posts
Default

Quote:
Originally Posted by PhilF View Post
Oh Oh... I'm in trouble. I'm a LEMP guy.
Socialist!!!

My rule is, I don't care what you use; just get the job done.
chalsall is offline   Reply With Quote
Old 2020-07-30, 20:40   #4939
James Heinrich
 
James Heinrich's Avatar
 
"James Heinrich"
May 2004
ex-Northern Ontario

52×112 Posts
Default

Quote:
Originally Posted by PhilF View Post
Oh Oh... I'm in trouble. I'm a LEMP guy.
Don't worry, I won't yell at you. (my server also runs nginx, but don't tell Chris)
James Heinrich is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Status Primeinator Operation Billion Digits 5 2011-12-06 02:35
62 bit status 1997rj7 Lone Mersenne Hunters 27 2008-09-29 13:52
OBD Status Uncwilly Operation Billion Digits 22 2005-10-25 14:05
1-2M LLR status paulunderwood 3*2^n-1 Search 2 2005-03-13 17:03
Status of 26.0M - 26.5M 1997rj7 Lone Mersenne Hunters 25 2004-06-18 16:46

All times are UTC. The time now is 05:58.

Thu Sep 24 05:58:09 UTC 2020 up 14 days, 3:09, 0 users, load averages: 1.50, 1.44, 1.34

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.