mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GPU to 72 (https://www.mersenneforum.org/forumdisplay.php?f=95)
-   -   GPU to 72 status... (https://www.mersenneforum.org/showthread.php?t=16263)

chris2be8 2020-07-30 15:43

[QUOTE=storm5510;551895]Another item, appearing in (Windows) Strawberry scripts, is [I]$|=1; [/I]What this does, I haven't a clue. It appears below the [I]use[/I] statements.[/QUOTE]

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.
[/quote]

Chris

storm5510 2020-07-30 16:53

[QUOTE=chris2be8;552026]From man perlvar (on Linux, but should apply to any OS):

Chris[/QUOTE]

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][COLOR=Gray]open my $pl,'>>','plist.txt';[/COLOR]
$pl->autoflush;[/QUOTE]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.

chalsall 2020-07-30 17:05

[QUOTE=storm5510;552031]There has to be differences between Linux Perl and Windows Perl. This is probably one of many.[/QUOTE]

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...

storm5510 2020-07-30 17:31

[QUOTE=chalsall;552032]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...[/QUOTE]

As I suspected...

I've looked at the spider quite a bit. Most of the code, I cannot grasp. It goes way beyond my [I]Perl[/I] 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.

chalsall 2020-07-30 17:56

[QUOTE=storm5510;552038]I've looked at the spider quite a bit. Most of the code, I cannot grasp. It goes way beyond my [I]Perl[/I] 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.[/QUOTE]

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 [URL="https://en.wikipedia.org/wiki/Regular_expression"]Regular Expressions[/URL].

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. :smile:

PhilF 2020-07-30 19:35

[QUOTE=chalsall;552040]Perl really is the "Internet's Duct-tape". It does Strings in its sleep, and makes gluing software components together trivial.[/QUOTE]

Sounds like you are describing awk:

[STRIKE]Perl[/STRIKE] Awk really is "[STRIKE]Internet[/STRIKE] Unix's Duct-tape". It does Strings in its sleep, and makes gluing software components together trivial. :smile:

chalsall 2020-07-30 19:52

[QUOTE=PhilF;552047]Sounds like you are describing awk:[/QUOTE]

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)...) :wink:

James Heinrich 2020-07-30 19:55

[QUOTE=chalsall;552049]Hey, James and I argue enough about what the P in LAMP should really mean[/QUOTE]There's no argument. I was just lurking and keeping myself quietly out of trouble... :hello:

PhilF 2020-07-30 20:25

[QUOTE=James Heinrich;552050]There's no argument. I was just lurking and keeping myself quietly out of trouble... :hello:[/QUOTE]

Oh Oh... I'm in trouble. I'm a LEMP guy. :blahblahblah:

chalsall 2020-07-30 20:31

[QUOTE=PhilF;552051]Oh Oh... I'm in trouble. I'm a LEMP guy. :blahblahblah:[/QUOTE]

Socialist!!! :wink:

My rule is, I don't care what you use; just get the job done. :smile:

James Heinrich 2020-07-30 20:40

[QUOTE=PhilF;552051]Oh Oh... I'm in trouble. I'm a LEMP guy. :blahblahblah:[/QUOTE]Don't worry, I won't yell at you. [COLOR="Silver"](my server also runs nginx, but don't tell Chris)[/COLOR]


All times are UTC. The time now is 22:33.

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