Re: Perl script: where was I executed from?

2020-11-22 Thread Vlado Keselj
Hi, I am not sure that I completely understand your question (for example, what does it mean to run a script "dynamically or not"). You could retrieve the list of processes from OS to try to figure out how was the script ran, but it is a bit messy. Just maybe: maybe you want to see w

Re: Perl script: where was I executed from?

2020-11-21 Thread Uri Guttman
On 11/22/20 12:33 AM, wagsworl...@yahoo.com wrote: The only problem I was trying to determine was could i know if I was running from BBEdit dynamically or not? That was the question. No problem, just could I know what environment I was running in. The output was a the Unix output log which up t

Re: Perl script: where was I executed from?

2020-11-21 Thread wagsworld48 via beginners
: > On 11/21/20 10:32 PM, wagsworl...@yahoo.com wrote: > > Well, up until this last update is BBEdit, when a script was run while > > in BBEdit, the Unix log file would automatically come to the fore > > front. Now it stays hidden. > > > > that doesn't sound like a

Re: Perl script: where was I executed from?

2020-11-21 Thread Uri Guttman
On 11/21/20 10:32 PM, wagsworl...@yahoo.com wrote: Well, up until this last update is BBEdit, when a script was run while in BBEdit, the Unix log file would automatically come to the fore front. Now it stays hidden. that doesn't sound like a perl problem. what log file? there are many

Re: Perl script: where was I executed from?

2020-11-21 Thread wagsworld48 via beginners
Well, up until this last update is BBEdit, when a script was run while in BBEdit, the Unix log file would automatically come to the fore front. Now it stays hidden. A gentleman on the BBEdit mail list gave an   osasctipt that one can execute from within the script bring executed. But sometimes

Re: Perl script: where was I executed from?

2020-11-21 Thread Uri Guttman
On 11/21/20 7:42 PM, wagsworld48 via beginners wrote: It was a good idea, but that gives me zsh which is what in this case BBEdit uses to execute the script. So with your code of $ENV, then I looked at the variables within ENV and picked one that was there for BBEdit and not there in a normal

Re: Perl script: where was I executed from?

2020-11-21 Thread wagsworld48 via beginners
It was a good idea, but that gives me zsh which is what in this case BBEdit uses to execute the script. So with your code of $ENV, then I looked at the variables within ENV and picked one that was there for BBEdit and not there in a normal terminal run. Know other ways, but this at least is one

Re: Perl script: where was I executed from?

2020-11-21 Thread sisyphus
Perhaps: perl -le 'print $ENV{SHELL}' Cheers, Rob On Sun, Nov 22, 2020 at 8:00 AM wagsworld48 via beginners < beginners@perl.org> wrote: > Mind is blank, but want to know if started with say BBEdit or bash or ? > > Probably very simple, but at this point, no idea... ;) > > WagsWorld > World of P

Perl script: where was I executed from?

2020-11-21 Thread wagsworld48 via beginners
Mind is blank, but want to know if started with say BBEdit or bash or ? Probably very simple, but at this point, no idea... ;) WagsWorld World of Perl Hebrews 4:15 Ph D:(408)914-1341 Ph M:(408)761-7391

Re: question about perl script

2019-10-30 Thread John W. Krahn
On 2019-10-29 7:48 p.m., 刘东 wrote: Dear every one: Hello. I try to write a perl script to delet the content of file carp01_1_both.txt as same as from another file carp-carp01_TKD181002053-1_1_sg.txt, so to get a new file from file carp-carp01_TKD181002053-1_1_sg.txt but excluding file

Re: question about perl script

2019-10-30 Thread Rob Coops
hand this over to the next person that might want to understand what you are doing or how you are doing that even though you are no longer there to ask those questions (or after a few years you no longer remember) Regards, Rob On Wed, Oct 30, 2019 at 7:04 AM Uri Guttman wrote: > On 10/29/1

Re: question about perl script

2019-10-29 Thread Uri Guttman
On 10/29/19 10:48 PM, 刘东 wrote: Dear every one: I try to write a perl script to delet the content of file carp01_1_both.txt as same as from another file carp-carp01_TKD181002053-1_1_sg.txt, so to get a new file from file carp-carp01_TKD181002053-1_1_sg.txt but excluding file

question about perl script

2019-10-29 Thread 刘东
Dear every one: I try to write a perl script to delet the content of file carp01_1_both.txt as same as from another file carp-carp01_TKD181002053-1_1_sg.txt, so to get a new file from file carp-carp01_TKD181002053-1_1_sg.txt but excluding file carp01_1_both.txt. However, when I run this scrip

perl script problem

2019-10-13 Thread 刘东
Dear every one, I have written a perl script to get seprated files, but finally I every file included multiple files appeared before, for example, 1 file 2M, 2 file 5 M( included last one), 3 file 6 M (included last two ones), ... but I expected as 1 file 2M, 2 file 3M, 3 file 1 M, ... the

Re: perl script with wrong

2019-10-13 Thread Jim Gibson
> On Oct 10, 2019, at 6:04 PM, 刘东 wrote: > > Dear friends, > I have written a perl script to get seprated files, but finally I every file > included multiple files appeared before, > for example, 1 file 2M, 2 file 5 M( included last one), 3 file 6 M (included > last t

perl script with wrong

2019-10-13 Thread 刘东
Dear friends, I have written a perl script to get seprated files, but finally I every file included multiple files appeared before, for example, 1 file 2M, 2 file 5 M( included last one), 3 file 6 M (included last two ones), ... but I expected as 1 file 2M, 2 file 3M, 3 file 1 M, ... the script

Re: perl script question

2019-10-10 Thread John W. Krahn
On 2019-10-09 7:21 p.m., 刘东 wrote: hellow: I have written a script, but it does not work, can you tell me what wrong with me? #! /usr/bin/perl use strict; use warnings; use Getopt::Long; my ($dir, $files, $file_name, $file_format, $file_dir, $file_main); GetOptions ('dr=s' =>

Re: perl script question

2019-10-10 Thread John W. Krahn
On 2019-10-09 7:21 p.m., 刘东 wrote: hellow: I have written a script, but it does not work, can you tell me what wrong with me? #! /usr/bin/perl use strict; use warnings; use Getopt::Long; my ($dir, $files, $file_name, $file_format, $file_dir, $file_main); GetOptions ('dr=s' =>

Re: perl script question

2019-10-10 Thread Ken Slater
19 at 4:06 AM 刘东 wrote: > hellow: > I have written a script, but it does not work, can you tell me what wrong > with me? > > #! /usr/bin/perl > > use strict; > use warnings; > use Getopt::Long; > > my ($dir, $files, $file_name, $file_format, $file_dir, $file_main); >

Re: perl script question

2019-10-10 Thread David Precious
om whatever the "usearch" tool you're executing is. Have your script print out the ./usearch invocation instead of running it, then try running it yourself - if you get the same error then you at least know that it's not coming from your script. My guess - did you mean &quo

perl script question

2019-10-10 Thread 刘东
hellow: I have written a script, but it does not work, can you tell me what wrong with me? #! /usr/bin/perl use strict; use warnings; use Getopt::Long; my ($dir, $files, $file_name, $file_format, $file_dir, $file_main); GetOptions ('dr=s' =>\$dir); open INF,"<",&#

Re: Help with Perl 6 script

2019-08-12 Thread Ralph Mellor
the > I have this Perl 6 script from Rosetta, which I wanted to run on Perl 5 > (due to the Active Sate Perl and App version that I have). If ActiveState have packaged https://metacpan.org/pod/Inline::Perl6 then please install and use that. (If they haven't, please ask th

Re: Help with Perl 6 script

2019-08-12 Thread Ralph Mellor
Oops, missed the ending. loop with a parens argument is like a C for with 3 args, init, test, next. The next bit is: ($t, @ABC) »+=« (.01, dABC($t, @ABC, .01)) The » and « opops (or metaops) pack a whole lot of power but can also be used for relatively simple cases like this one in which th

Re: Help with Perl 6 script

2019-08-12 Thread Marc Chantreux
hello Rui, > I have this Perl 6 script from Rosetta, which I wanted to run on Perl 5 > (due to the Active Sate Perl and App version that I have). Perl6 and Perl5 are very different. you need to download a perl6 interpretor if you want to run perl6 code. please check https://raku

Re: Help with Perl 6 script

2019-08-12 Thread Andy Bach
nd there is the p6 users list perl6-us...@perl.org at: https://lists.perl.org/all.html#p From: Rui Fernandes Sent: Thursday, August 8, 2019 3:07 PM To: Perl Beginners Subject: Help with Perl 6 script Greetings I have this Perl 6 script from Rosetta, which I wante

Re: Help with Perl 6 script

2019-08-12 Thread William Michels via beginners
this Perl 6 script from Rosetta, which I wanted to run on Perl 5 (due > to the Active Sate Perl and App version that I have). However, several syntax > errors appear given the difference (some) in language.Here's the script: > > --- > > # Simple Vector implementation > multi

Re: Help with Perl 6 script

2019-08-12 Thread Bruce Gray
[ Executive Summary: Install Perl 6; it will not disturb your Activestate Perl 5 : https://rakudo.org/files ] > On Aug 8, 2019, at 3:07 PM, Rui Fernandes wrote: > > Greetings Hi Rui! > > I have this Perl 6 script from Rosetta, which I wanted to run on Perl 5 (due > to th

Help with Perl 6 script

2019-08-08 Thread Rui Fernandes
Greetings I have this Perl 6 script from Rosetta, which I wanted to run on Perl 5 (due to the Active Sate Perl and App version that I have). However, several syntax errors appear given the difference (some) in language.Here's the script: --- # Simple Vector implementation multi infix:<+

Re: help with a stat script

2018-07-12 Thread Uri Guttman
On 07/12/2018 11:40 PM, Lauren C. wrote: Hi Uri, I was reading this page: https://www.rexegg.com/regex-lookarounds.html the content of "Mastering Lookahead and Lookbehind" make me confused. (?=foo) (?<=foo) (?!foo) (?i suggest you don't study lookarounds until you are stronger with basic rege

Re: help with a stat script

2018-07-12 Thread Lauren C.
Hi Uri, I was reading this page: https://www.rexegg.com/regex-lookarounds.html the content of "Mastering Lookahead and Lookbehind" make me confused. (?=foo) (?<=foo) (?!foo) (?but seriously, regexes are a key feature in perl and most modern languages. it is hard to do any text or data processi

Re: help with a stat script

2018-07-12 Thread Uri Guttman
On 07/12/2018 08:53 PM, Lauren C. wrote: OK I see, thanks Gil. I think the main problem is I don't know much about regex. I will re-learn them this day. heh, relearning regexes will take a lifetime, not just one day! :) but seriously, regexes are a key feature in perl and most modern languages

Re: help with a stat script

2018-07-12 Thread Lauren C.
2_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" A perl script for stat purpose of this log: tail -f /var/log/apache2/access.log|perl -nle 'next unless m{^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+}; printf "%-20s%-40s%-40s\n",$1,$3,$2'

Re: help with a stat script

2018-07-12 Thread Lauren C.
OK I see, thanks Gil. I think the main problem is I don't know much about regex. I will re-learn them this day. On 2018/7/12 星期四 PM 10:02, Gil Magno wrote: 2018-07-12 20:50:22 +0800 Lauren C.: thanks for the kind helps. do you know what the expression in { } stands for? ^(\S+) - - \[(\S+).*\]

Re: help with a stat script

2018-07-12 Thread Lauren C.
Thanks Jim. that explains clearly. On 2018/7/12 星期四 PM 10:00, Jim Gibson wrote: On Jul 12, 2018, at 5:50 AM, Lauren C. wrote: thanks for the kind helps. do you know what the expression in { } stands for? ^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+ Here is a breakdown: ^ Start lo

Re: help with a stat script

2018-07-12 Thread John W. Krahn
gt; "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36  > (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" > > A perl script for stat purpose of this log: > > tail -f /var/log/apache2/access.log|perl -nle 'next unless m{^(\S+) - > -  >

Re: help with a stat script

2018-07-12 Thread Jim Gibson
> On Jul 12, 2018, at 5:50 AM, Lauren C. wrote: > > thanks for the kind helps. > do you know what the expression in { } stands for? > > ^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+ Here is a breakdown: ^ Start looking for matches at beginning of string (\S+) Match a consecutive seq

Re: help with a stat script

2018-07-12 Thread Gil Magno
2018-07-12 20:50:22 +0800 Lauren C.: > thanks for the kind helps. > do you know what the expression in { } stands for? > > ^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+ Hi, Lauren This is quickly explained in http://perldoc.perl.org/perlrequick.html#Using-character-classes \s (lowercase) stands for a

Re: help with a stat script

2018-07-12 Thread Lauren C.
thanks for the kind helps. do you know what the expression in { } stands for? ^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+ On 2018/7/12 星期四 PM 8:37, Илья Рассадин wrote: "m{ pattern }" is regular expression to parse log string. It's equal to just "/ pattern /". Using different delimiter is conven

Re: help with a stat script

2018-07-12 Thread Lauren C.
thanks Magno. i will check it. On 2018/7/12 星期四 PM 8:13, Gil Magno wrote: Hi, Lauren The m{...} is a regular expression (regexp). If you not familiar with regexps in Perl, I advise you to read these pages: -http://perldoc.perl.org/perlintro.html#Regular-expressions -http://perldoc.perl.org/per

Re: help with a stat script

2018-07-12 Thread Gil Magno
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, > like Gecko) Chrome/67.0.3396.99 Safari/537.36" > > A perl script for stat purpose of this log: > > tail -f /var/log/apache2/access.log|perl -nle 'next unless m{^(\S+) - - > \[(\S+).*\] \"G

Re: help with a stat script

2018-07-12 Thread Илья Рассадин
"GET /2018/07/06/antique-internet/ HTTP/1.1" 200 5489 "https://miscnote.net/"; "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" A perl script for stat purpose of this log: tail -f /var/l

help with a stat script

2018-07-12 Thread Lauren C.
KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36" A perl script for stat purpose of this log: tail -f /var/log/apache2/access.log|perl -nle 'next unless m{^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+}; printf "%-20s%-40s%-40s\n",$1,$3,$2' I was totally confused abo

Re: [OT] converting a script to a distribution

2017-12-07 Thread Shlomi Fish
a, or alike, and assuming each script > has already its git story and configuration files laying around, what > is the better way to start at? Any pointer? See http://perl-begin.org/topics/cpan/ and also read about modulinos - https://duckduckgo.com/?q=perl+modulino&ia=web . There is also App

[OT] converting a script to a distribution

2017-11-29 Thread Luca Ferrari
Hi all, This is not quite tied to Perl itself, but I'm trying to migrate a few stand-alone scripts I've written to fully distributions, may be uploaded to CPAN. Now, using a tool like distzilla, or alike, and assuming each script has already its git story and configuration files lay

Re: Getting the results of a remote script

2017-11-10 Thread Gary Stainburn
Hi Shlomi, On Friday 10 November 2017 11:52:12 Shlomi Fish wrote: > > While I agree, see http://seriot.ch/parsing_json.php for a roundup of > security problems and inconsistencies in JSON parsers. Thanks for this, I'll give it a look when I get the chance. Thankfully, so far I haven't seen any p

Re: Getting the results of a remote script

2017-11-10 Thread Shlomi Fish
Hi Gary, On Fri, 10 Nov 2017 09:48:30 + Gary Stainburn wrote: > On Friday 10 November 2017 00:08:09 SSC_perl wrote: > > > On Nov 9, 2017, at 2:06 PM, David Precious wrote: > > > > > > you'll get whatever the script output to STDOUT. > > > >

Re: Getting the results of a remote script

2017-11-10 Thread Gary Stainburn
On Friday 10 November 2017 00:08:09 SSC_perl wrote: > > On Nov 9, 2017, at 2:06 PM, David Precious wrote: > > > > you'll get whatever the script output to STDOUT. > > Thanks a million, Dave! STDOUT was what I was missing. I've never used > that before

Re: Getting the results of a remote script

2017-11-09 Thread SSC_perl
> On Nov 9, 2017, at 2:06 PM, David Precious wrote: > > you'll get whatever the script output to STDOUT. Thanks a million, Dave! STDOUT was what I was missing. I've never used that before, so this was news to me. The remote script now returns a string that I can

Re: Getting the results of a remote script

2017-11-09 Thread David Precious
hanks, Heince. I had mistakenly thought those were > synonymous with each other. And, of course, this morning, doing a > new search produced the backtick solution. However, every example I > found was for a unix command, not a perl script. > > Using the backticks returns noth

Re: Getting the results of a remote script

2017-11-09 Thread SSC_perl
e, this morning, doing a new search produced the backtick solution. However, every example I found was for a unix command, not a perl script. Using the backticks returns nothing, so perhaps my remote script may not be set up properly to "export" it's result? Sorry -

Re: Getting the results of a remote script

2017-11-09 Thread Andy Bach
$list = system('ssh usern...@domain.com '/usr/bin/perl /cgi-bin/dir-list.pl '"); Hmm, if it's a cgi-bin script, wouldn't use LWP (or curl or ...) work too? On Wed, Nov 8, 2017 at 6:15 PM, SSC_perl wrote: > I have a script on a remote server that creat

Re: Getting the results of a remote script

2017-11-09 Thread Shlomi Fish
org/topics/security/code-markup-injection/ * https://metacpan.org/pod/String::ShellQuote Also see http://perl-begin.org/tutorials/bad-elements/#declaring_all_vars_at_top regarding predeclaration. > Regards, > Heince > > On Thu, Nov 9, 2017 at 7:15 AM, SSC_perl wrote: > > >

Re: Getting the results of a remote script

2017-11-08 Thread thelip sia
you can use backtick to store the output. $list = `ssh usern...@domain.com '/usr/bin/perl /cgi-bin/dir-list.pl'`; Regards, Heince On Thu, Nov 9, 2017 at 7:15 AM, SSC_perl wrote: > I have a script on a remote server that creates a list of all > directories on the serv

Getting the results of a remote script

2017-11-08 Thread SSC_perl
I have a script on a remote server that creates a list of all directories on the server that end in a dash. I need that list on my laptop. Is it possible to get the result into a variable in my local script by triggering the remote script via ssh? I've tried this: $list = s

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-02-25 Thread khalil zakaria Zemmoura
Naming multiple variables with the same name like you did ($args, %args) is a bad idea. because when you want to access the value of the hash %args ($args{FN}) you are accessing in reality what was shifted in the scalar $args and not the hash %args because perl use simbolic reference. here is a li

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-02-25 Thread ZEMMOURA Khalil Zakaria
are accessing in reality what was shifted in the scalar $args and not the hash %args because perl use simbolic reference. here is a link that explain that https://perlmaven.com/symbolic-reference-in-perl > > the script won't even execute. Both give the same error > > pe

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-16 Thread Chris Fedde
access sharing come up can be handled with the way linux group membership works and use of the setgid bit on directories. If "appuser" is a member of "othergroup" and the directory where the script will write the file is setgid "othergroup" then when the script writ

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread Chas. Owens
snip > So I guess the question is - > > - is there a way in perl to authorize the callED perl script to have > higher perms than the callING app's, so that it can write to the file I'm > targeting? > > Or do I have to to this OUTSIDE of the perl script? > T

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Chas. Owens
de an error. In the second set of error messages, you get better location information and better overall information. Now, this is obviously better for the maintainer, but it comes at the cost of more verbose code. If this is a one-off script, then it probably isn't worthwhile; however, if

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread alanj
uss with. Not sure yet. > Can you please show your real program and data input, together with the > output you want? We will also need to understand what parameters are being > passed to your program, and where it gets the new values for user and group. Here's the latest, current

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Rob Dixon
15 January 2017 20:09:53 GMT+00:00, al...@myfastmail.com wrote: >Hi, > >I have a simple script with a subroutine that I pass scalar & array >arguments to, > > #!/usr/bin/perl > > use 5.01201; > use strict; > use warnings; > &

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread Rob Dixon
the new values for user and group. Thanks. Rob Dixon On 15 January 2017 22:45:43 GMT+00:00, al...@myfastmail.com wrote: >I have an application that calls a perl script, feeding it input over >STDIN. > >The perl script takes that input, processes it, and writes is as a >change

How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread alanj
I have an application that calls a perl script, feeding it input over STDIN. The perl script takes that input, processes it, and writes is as a change to an output file. I use Path::Tiny, and this works ok, use Path::Tiny qw(path); my $newdata = $@; $newdata = (some

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread alanj
Hi, On Sun, Jan 15, 2017, at 01:01 PM, Shawn H Corey wrote: > > Is there a different, recommended way? > > Nothing's wrong. perlcritic does not this valid method, that's all. > > TIMTOWTDI (There Is More Than One Way To Do It.) Hm, ok. As long as it's not wrong/broken in some weird way. I kep

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Shawn H Corey
On Sun, 15 Jan 2017 12:09:53 -0800 al...@myfastmail.com wrote: > What's wrong with the way I'm unpacking the arguments passed to the > subroutine, > > my %args = %{ shift @_ }; > > Is there a different, recommended way? Nothing's wrong. perlcritic does not this valid method, that's all.

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Илья Рассадин
my @dr = @{$args{DR}}; return; } the script won't even execute. Both give the same error perl /home/aj/test.pl Global symbol "%args" requires explicit package name at /home/aj/test.pl line 30. Global symbol &qu

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread alanj
30 my $fn = $args{FN}; my $ar = $args{AR}; my $ad = $args{AD}; my @dr = @{$args{DR}}; return; } the script won't even execute. Both give the same error

Re: script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread Илья Рассадин
Hi! I think, you can use this aproach sub modrec { my ($args) = @_; # or my $args = shift @_; use what you like more my $fn = $args->{'FN'}; } 15.01.17 23:09, al...@myfastmail.com пишет: Hi, I have a simple script with a subroutine that I pass scalar &

script that passes args to subroutine works ok, after I unpack the args. But perlcritic says I'm not unpacking?

2017-01-15 Thread alanj
Hi, I have a simple script with a subroutine that I pass scalar & array arguments to, #!/usr/bin/perl use 5.01201; use strict; use warnings; my $this_fn = "input.txt"; my @this_dr = qw( /path/1 /path/2

Re: Script runs slower with better hardware

2016-06-02 Thread David Santiago
t;> Hello James, >> >> The CPUs are >> >> Laptop CPU: i7 Q 720 >> Desktop CPU: i5 6500T >> >> The rest of software i'm using: >> >> Perl version: 5.22 >> Net::SSLeay version: 1.72 >> Openssl version: 1.0.2.h >> OS: A

Re: Script runs slower with better hardware

2016-06-02 Thread James Alton
st of software i'm using: > > Perl version: 5.22 > Net::SSLeay version: 1.72 > Openssl version: 1.0.2.h > OS: Archlinux up to date. > > > The script is single threaded and i'm using a single > IO::Select->select() to know when i should write or read.

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
Hello James, The CPUs are Laptop CPU: i7 Q 720 Desktop CPU: i5 6500T The rest of software i'm using: Perl version: 5.22 Net::SSLeay version: 1.72 Openssl version: 1.0.2.h OS: Archlinux up to date. The script is single threaded and i'm using a single IO::Select->select() t

Re: Script runs slower with better hardware

2016-06-01 Thread James Alton
, 2016 at 12:25 PM, David Emanuel da Costa Santiago < deman...@gmail.com> wrote: > > Hi! > > I have a script that writes to a socket, but i noticed that the same > script have diferent speeds on different machines. It's faster on my > 5 year laptop than on my desktop. &g

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
t, > > > > They are using the same verion of Net::SSLeay (version 1.72). All > > the software have the same version. > > > > This is not random. This happens 100% of the times. > > > > All the settings related to this script are the same. > > >

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
The openssl version is 1.0.2.h. Thanks for your help. I'm going to follow Uri's advice and send an email to p5p list. Thank you! Regards, David Santiago On Thu, 2 Jun 2016 08:18:23 +1200 Kent Fredric wrote: > On 2 June 2016 at 08:04, David Emanuel da Costa Santiago > wrote: > > They are us

Re: Script runs slower with better hardware

2016-06-01 Thread Kent Fredric
On 2 June 2016 at 08:04, David Emanuel da Costa Santiago wrote: > They are using the same verion of Net::SSLeay (version 1.72). All the > software have the same version. No, not Net::SSLeay ... OpenSSL, which it links against. And if you recently upgraded/downgraded OpenSSL to match versions, N

Re: Script runs slower with better hardware

2016-06-01 Thread Uri Guttman
On 06/01/2016 04:04 PM, David Emanuel da Costa Santiago wrote: Hi Kent, They are using the same verion of Net::SSLeay (version 1.72). All the software have the same version. This is not random. This happens 100% of the times. All the settings related to this script are the same. I don&#

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
Hi Kent, They are using the same verion of Net::SSLeay (version 1.72). All the software have the same version. This is not random. This happens 100% of the times. All the settings related to this script are the same. I don't think it's my network card, because i can reach the max

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
oldest hardware runs faster. The SSLeay version is the same on both machines (version 1.72 - the latest one haven't reach the stable repos yet) Regards, David Santiago On Wed, 1 Jun 2016 22:23:51 +0300 Shlomi Fish wrote: > On Wed, 1 Jun 2016 20:25:39 +0200 > David Emanuel da Costa Santia

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
r applications i can reach same speed with SSL on both machines. Regards, David Santiago On Wed, 01 Jun 2016 19:36:06 +0100 Steve Pointer wrote: > Does your laptop have a TPM? > > > > On 1 June 2016 19:25:39 BST, David Emanuel da Costa Santiago > wrote: > > > >

Re: Script runs slower with better hardware

2016-06-01 Thread Kent Fredric
On 2 June 2016 at 06:25, David Emanuel da Costa Santiago wrote: > The question for one million dollar is "Why?". And how can i improve > the performance of my desktop to reach the same speed as my laptop > (considering that i have better hardware on my desktop)? If i recompile > perl instead of us

Re: Script runs slower with better hardware

2016-06-01 Thread Shlomi Fish
On Wed, 1 Jun 2016 20:25:39 +0200 David Emanuel da Costa Santiago wrote: > Hi! > > I have a script that writes to a socket, but i noticed that the same > script have diferent speeds on different machines. It's faster on my > 5 year laptop than on my desktop. > > I p

Re: Script runs slower with better hardware

2016-06-01 Thread Shlomi Fish
On Wed, 1 Jun 2016 20:25:39 +0200 David Emanuel da Costa Santiago wrote: > Hi! > > I have a script that writes to a socket, but i noticed that the same > script have diferent speeds on different machines. It's faster on my > 5 year laptop than on my desktop. > > I p

Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
Hi! I have a script that writes to a socket, but i noticed that the same script have diferent speeds on different machines. It's faster on my 5 year laptop than on my desktop. I profiled the script on both machines and some functions are taking almost the double of the time! Example:

Re: Script to fork, send data to parent via a tcp conn

2016-05-16 Thread Jim Gibson
> On May 15, 2016, at 5:05 AM, Unknown User wrote: > > The port is not in use before i run the script. It is in use when i > run it. However the problem is that only one iteration runs. I > expected all to run. Your ‘listen’ statement is in a loop. Therefore, the second time th

Re: Script to fork, send data to parent via a tcp conn

2016-05-16 Thread Unknown User
The port is not in use before i run the script. It is in use when i run it. However the problem is that only one iteration runs. I expected all to run. On Sun, May 15, 2016 at 1:52 AM, Jon E Price wrote: > Perhaps port 8989 is in use? > > Have you tried >telnet 127.0 0.1 8989

Re: Script to fork, send data to parent via a tcp conn

2016-05-14 Thread lee
Unknown User writes: > I wrote this scrpt to fork off a few child processes, then the child > processes process some data, and send the data back to the parent > through a tcp socket. > This is not working as i expected it would. Why not? How can it be corrected? > > > #!/usr/bin/perl -w > use st

Re: Script to fork, send data to parent via a tcp conn

2016-05-14 Thread Uri Guttman
On 05/13/2016 11:30 AM, Unknown User wrote: I wrote this scrpt to fork off a few child processes, then the child processes process some data, and send the data back to the parent through a tcp socket. This is not working as i expected it would. Why not? How can it be corrected? there are many i

Re: Script to fork, send data to parent via a tcp conn

2016-05-14 Thread Jon E Price
Perhaps port 8989 is in use? Have you tried >telnet 127.0 0.1 8989 Can you connect? On May 14, 2016, at 3:56 PM, Unknown User wrote: >I wrote this scrpt to fork off a few child processes, then the child >processes process some data, and send the data back to the parent >through a tcp socke

Script to fork, send data to parent via a tcp conn

2016-05-14 Thread Unknown User
I wrote this scrpt to fork off a few child processes, then the child processes process some data, and send the data back to the parent through a tcp socket. This is not working as i expected it would. Why not? How can it be corrected? #!/usr/bin/perl -w use strict; use IO::Socket::INET; print $$,

Re: perl script with errors?

2015-11-26 Thread Shlomi Fish
Hi Miguel, On Wed, 25 Nov 2015 20:28:48 -0500 Miguel Rodas wrote: > Why am I in this thread? > > Please remove me from it > You are likely subscribed to beginners@perl.org and so receive all E-mails from all threads. For how to unsubscribe, see http://learn.perl.org/faq/beginners.html . Rega

Re: perl script with errors?

2015-11-26 Thread Shlomi Fish
Hi Jin, some comments on your code: On Thu, 26 Nov 2015 08:13:54 +0800 Jin Xu wrote: > Try to use below updated ones: > > #!/usr/bin/perl > use strict; > use warnings; > while (my $line = <>) { You're lacking many empty lines - separating the code into paragraphs. See: http://perl-begin.org/

Re: perl script with errors?

2015-11-25 Thread Miguel Rodas
Why am I in this thread? Please remove me from it Sent from my iPhone > On Nov 25, 2015, at 7:13 PM, Jin Xu wrote: > > Try to use below updated ones: > > #!/usr/bin/perl > use strict; > use warnings; > while (my $line = <>) { > while ($line =~ > s#\d+\s*[*+-/]\s*\d+(\s*[*+-/]\s*\d

Re: perl script with errors?

2015-11-25 Thread Jin Xu
Try to use below updated ones: #!/usr/bin/perl use strict; use warnings; while (my $line = <>) { while ($line =~ s#\d+\s*[*+-/]\s*\d+(\s*[*+-/]\s*\d+)*##) { my $result; eval ("$result = $&;"); $line =~ s//$result/; } print ($line); } Regards, Jin Xu

Re: perl script with errors?

2015-11-25 Thread Rui Fernandes
Hi Gary, I don't know what you are trying to do with that code... :( Still, it's valid this way: #!/usr/bin/perl use strict; use warnings; print "Content-type: text/html\n\n"; #Only if you want this format while (my $line = <>) { while ($line =~ s#\d+\s*[*+-/]\s*\d+(\s*[*+-/]\s*\d+)*##) {

Re: perl script with errors?

2015-11-25 Thread Olivier Le Monnier
> gb@MINT ~/Perl5/perl programs $ cat prog164.pl > #!/usr/bin/perl > use strict; > use warnings; > while ($line = <>) { > while ($line =~ > s#\d+\s*[*+-/]\s*\d+(\s*[*+-/]\s*\d+)*##) { > eval ("\$result = $&;"); > $line =~ s//$result/; > > } > print ($line); > }

perl script with errors?

2015-11-25 Thread Gary Baker
gb@MINT ~/Perl5/perl programs $ cat prog164.pl #!/usr/bin/perl use strict; use warnings; while ($line = <>) { while ($line =~ s#\d+\s*[*+-/]\s*\d+(\s*[*+-/]\s*\d+)*##) { eval ("\$result = $&;"); $line =~ s//$result/; } print ($line); } gb@MINT ~/Perl5/perl pr

Re: script to parse OCR output different between servers

2015-07-22 Thread Gary Stainburn
All I can say is,, I've not had a good day. This is the correct code for getting the most popular value. I'd forgot to update $count with $value foreach my $field (keys %found) { # foreach field my $value=''; my $count=0; foreach my $key (keys %{$found{$field}}) { # foreach field -> value

Re: script to parse OCR output different between servers

2015-07-22 Thread Gary Stainburn
Below is my revised code based on your comments. It is tidier but more importantly it works correctly. Ironically, it didn't actually work correctly before on my dev machine either,– it didn't find all matches. It looks like using my original code it was only using the first element in each

Re: script to parse OCR output different between servers

2015-07-22 Thread Shlomi Fish
Hi Gary, see below for my comments. On Wed, 22 Jul 2015 17:11:29 +0100 Gary Stainburn wrote: > On Wednesday 22 July 2015 16:10:18 Shlomi Fish wrote: > > Hi Gary, > > > > some comments about your code. > > > > On Wed, 22 Jul 2015 15:32:33 +0100 > > > > Gary Stainburn wrote: > > > I've written t

  1   2   3   4   5   6   7   8   9   10   >