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
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
:
> 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
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
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
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
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
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
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
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
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
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
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
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
> 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
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
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' =>
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' =>
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);
>
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
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,"<",
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
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
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
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
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
[ 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
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:<+
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
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
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
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'
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+).*\]
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
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+) -
> -
>
> 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
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
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
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
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
"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
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
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
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
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
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.
> >
> >
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
> 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
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
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 -
$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
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:
>
> >
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
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
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
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
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
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
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
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
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;
>
&
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
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
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
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.
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
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
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 &
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
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
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.
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
, 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
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.
> >
>
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
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
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
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
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
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:
> >
> >
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
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
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
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:
> 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
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
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
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
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
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 $$,
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
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/
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
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
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+)*##) {
> 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 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
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
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
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 - 100 of 4369 matches
Mail list logo