mersenneforum.org GPU to 72 status...
 Register FAQ Search Today's Posts Mark Forums Read

2020-07-30, 15:43   #4929
chris2be8

Sep 2009

2·33·5·7 Posts

Quote:
 Originally Posted by storm5510 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

2020-07-30, 16:53   #4930
storm5510
Random Account

Aug 2009
U.S.A.

5DB16 Posts

Quote:
 Originally Posted by chris2be8 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

2020-07-30, 17:05   #4931
chalsall
If I May

"Chris Halsall"
Sep 2002

3·7·443 Posts

Quote:
 Originally Posted by storm5510 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...

2020-07-30, 17:31   #4932
storm5510
Random Account

Aug 2009
U.S.A.

1,499 Posts

Quote:
 Originally Posted by chalsall 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.

2020-07-30, 17:56   #4933
chalsall
If I May

"Chris Halsall"
Sep 2002

221278 Posts

Quote:
 Originally Posted by storm5510 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.

2020-07-30, 19:35   #4934
PhilF

Feb 2005

3×132 Posts

Quote:
 Originally Posted by chalsall 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.

2020-07-30, 19:52   #4935
chalsall
If I May

"Chris Halsall"
Sep 2002

245716 Posts

Quote:
 Originally Posted by PhilF 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)...)

2020-07-30, 19:55   #4936
James Heinrich

"James Heinrich"
May 2004
ex-Northern Ontario

3,019 Posts

Quote:
 Originally Posted by chalsall 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...

2020-07-30, 20:25   #4937
PhilF

Feb 2005

1FB16 Posts

Quote:
 Originally Posted by James Heinrich 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.

2020-07-30, 20:31   #4938
chalsall
If I May

"Chris Halsall"
Sep 2002

3×7×443 Posts

Quote:
 Originally Posted by PhilF 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.

2020-07-30, 20:40   #4939
James Heinrich

"James Heinrich"
May 2004
ex-Northern Ontario

3,019 Posts

Quote:
 Originally Posted by PhilF 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)

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

All times are UTC. The time now is 13:25.

Sat Sep 19 13:25:54 UTC 2020 up 9 days, 10:36, 1 user, load averages: 1.54, 1.30, 1.35