Re: help with making an sftp connection

2023-04-17 Thread Jeremy.l SR
-o PreferredAuthentications=password >> -o PasswordAuthentication=yes >> -o BatchMode=yes >> ) >>] >> ) or $sftp->error; >> >> The clue to what is going wrong will be in the output from ssh. >> Thanks,

Re: help with making an sftp connection

2023-04-17 Thread Jeremy.l SR
10:13, Brent Wood via beginners > wrote: > > More detail, thanks for your time... > > > This is to test the Perl script on a local (Linux) system, copying a file > from /tmp to another directory. > > I can use command line sftp to copy a file fine with the user/passwo

Re: help with making an sftp connection

2023-04-17 Thread Dermot
a problem with sftp, user/password etc on the > system. > > This Perl script executes without error, but hangs on $sftp = Net::... > (prints start, never prints done) > > If I take out the password assignment, I'm prompted for a password and it > then works fine. With it ther

Re: help with making an sftp connection

2023-04-16 Thread Jim Gibson via beginners
ve any specific questions or problems. It is always good to give it a try for yourself before asking for help. Post what you try. > On Apr 16, 2023, at 2:40 PM, Brent Wood via beginners > wrote: > > Hi, > > I'm not a perl coder, (though have written a few very simple P

help with making an sftp connection

2023-04-16 Thread Brent Wood via beginners
f the old FTP code/logic, but need some help to make the actual connection. It is a secure (no external connectivity) network, with no public/private key security available, so authentication just via user/password Some Googling for how I might do this in Perl has thrown up several possibil

Re: Please help: perl run out of memory

2022-04-27 Thread David Emanuel da Costa Santiago
Às 11:33 de 17/04/22, wilson escreveu: hello the experts, can you help check my script for how to optimize it? currently it was going as "run out of memory". $ perl count.pl Out of memory! Killed My script: use strict; my %hash; my %stat; To be honest you don't need the

Re: Please help: perl run out of memory

2022-04-26 Thread hw
On Sun, 2022-04-17 at 17:33 +0800, wilson wrote: > hello the experts, > > can you help check my script for how to optimize it? > currently it was going as "run out of memory". > > $ perl count.pl > Out of memory! > Killed I would use a database like Mari

Re: Please help: perl run out of memory

2022-04-22 Thread David Precious
On Thu, 21 Apr 2022 07:12:07 -0700 al...@coakmail.com wrote: > OP maybe need the streaming IO for reading files. Which is what they were already doing - they used: while () { ... } Which, under the hood, uses readline, to read a line at a time. (where "HD" is their global fileh

Re: Please help: perl run out of memory

2022-04-21 Thread alice
OP maybe need the streaming IO for reading files. Thanks On 2022-04-21 21:56, David Precious wrote: > On Thu, 21 Apr 2022 17:26:15 +0530 > "M.N Thanishka sree Manikandan" wrote: > >> Hi wilson >> Try this module file::slurp > > Given that the OP is running into memory issues processing an 80

Re: Please help: perl run out of memory

2022-04-21 Thread David Precious
On Thu, 21 Apr 2022 17:26:15 +0530 "M.N Thanishka sree Manikandan" wrote: > Hi wilson > Try this module file::slurp Given that the OP is running into memory issues processing an 80+ million line file, I don't think suggesting a CPAN module designed to read the entire contents of a file into mem

Re: Please help: perl run out of memory

2022-04-21 Thread M.N Thanishka sree Manikandan
Hi wilson Try this module file::slurp Regards, Manikandan On Sun, 17 Apr, 2022, 15:03 wilson, wrote: > hello the experts, > > can you help check my script for how to optimize it? > currently it was going as "run out of memory". > > $ perl count.pl > Out of m

Re: Please help: perl run out of memory

2022-04-21 Thread Adriel Peng
I am not sure, but can Tie::Hash etc be used by tying hash to a local file to reduce the memory use? regards.

Re: Please help: perl run out of memory

2022-04-18 Thread Rob Coops
he final process of > picking out the top 20 doesn't allocate new storage for all 80 million > items. > > Does that make sense? I could bang out some code illustrating what I mean > if that would help. > > David > > On Sun, Apr 17, 2022, 5:33 AM wilson wrote: > >

Re: Please help: perl run out of memory

2022-04-17 Thread David Mertens
make sense? I could bang out some code illustrating what I mean if that would help. David On Sun, Apr 17, 2022, 5:33 AM wilson wrote: > hello the experts, > > can you help check my script for how to optimize it? > currently it was going as "run out of memory". > > $ p

Re: regex help - only one value returned

2020-12-02 Thread Jim Gibson
In your original example: print "match1='$1' '$2'\n" if ($T=~/^((mr|mrs|miss|dr|prof|sir) .{5,}?)\n/smi); print "match2='$1' '$2'\n" if ($T=~/^(mr|mrs|miss|dr|prof|sir .{5,}?)\n/smi); the interior parentheses in example one terminates the alternation, so the last string is ’sir’. In example two

Re: regex help - only one value returned

2020-12-02 Thread Gary Stainburn
On 02/12/2020 13:56, Vlado Keselj wrote: Well, it seems that the first one is what you want, but you just need to use $1 and ignore $2. You do need parentheses in '(mr|mrs|miss|dr|prof|sir)' but if you do not want for them to be captured in $2, you can use: '(?:mr|mrs|miss|dr|prof|sir)'. For ex

Re: regex help - only one value returned

2020-12-02 Thread Vlado Keselj
Well, it seems that the first one is what you want, but you just need to use $1 and ignore $2. You do need parentheses in '(mr|mrs|miss|dr|prof|sir)' but if you do not want for them to be captured in $2, you can use: '(?:mr|mrs|miss|dr|prof|sir)'. For example: print "match3='$1' '$2'\n" if (

regex help - only one value returned

2020-12-02 Thread Gary Stainburn
I have an array of regex expressions that I apply to text returned from tesseract. Each match that I get then gets stored for future processing. However, I'm struggling with one regex. The problem is that: 1) with brackets round the titles it returns two matches. 2) without brackets, it retu

Re: Help with REST API interaction.

2020-04-24 Thread Gil Magno
in order to achieve my desired >funcionalities and pass some values back to RT (for this I won't need your >help since the coding won't be done in Perl, sadly) >3. Decode the response I get back to Perl and use those values in RT to >do some more updating

Re: Help with REST API interaction.

2020-04-24 Thread Gil Magno
Correction: we should use $res->is_success in the 'if' below, not $ua->is_success. 2020-04-24 19:42:32 -0300 Gil Magno: > if ($ua->is_success) { signature.asc Description: PGP signature

Help with REST API interaction.

2020-04-24 Thread Francisco Acuña
EST::Client and JSON modules. And what I need to do is: 1. Encode the values I want to pass over to the API into a JSON object. 2. Do some coding on the other side in order to achieve my desired funcionalities and pass some values back to RT (for this I won't need your help since th

Re: Help me with a regex problem

2019-10-26 Thread Dermot
first looks > like an IP address and the second looks like a file path. In other > words I can't distinguish the difference between these two "types". > > > > I know how to write regex to match each line, but don't get the good > result > > with one

Re: Help me with a regex problem

2019-10-25 Thread John W. Krahn
looks like an IP address and the second looks like a file path. In other words I can't distinguish the difference between these two "types". I know how to write regex to match each line, but don't get the good result with one regex to match both lines. Can you help?

Re: Help me with a regex problem

2019-10-25 Thread Andy Bach
On 25.10.2019 13:23, Maggie Q Roth wrote: > > Hello > > > > There are two primary types of lines in the log: > > > > 60.191.38.xx/ > > 42.120.161.xx /archives/1005 > > > > I know how to write regex to match each line, but don

Re: Help me with a regex problem

2019-10-25 Thread Benjamin S Pendygraft II
; > 42.120.161.xx /archives/1005 >> > >> > I know how to write regex to match each line, but don't get the good >> > result with one regex to match both lines. >> > >> > Can you help? >> > >> > Thanks, >> > Maggie >> >> -- >> To unsubscribe, e-mail: beginners-unsubscr...@perl.org >> For additional commands, e-mail: beginners-h...@perl.org >> http://learn.perl.org/ >> >> >> -- Benjamin Pendygraft

Re: Help me with a regex problem

2019-10-25 Thread X Dungeness
gt; 42.120.161.xx /archives/1005 >> > >> > I know how to write regex to match each line, but don't get the good >> > result with one regex to match both lines. >> > >> > Can you help? >> > >> > Thanks, >> > Maggie >> >> -- >> To unsubscribe, e-mail: beginners-unsubscr...@perl.org >> For additional commands, e-mail: beginners-h...@perl.org >> http://learn.perl.org/ >> >> >>

Re: Help me with a regex problem

2019-10-25 Thread Maggie Q Roth
of lines in the log: > > > > 60.191.38.xx/ > > 42.120.161.xx /archives/1005 > > > > I know how to write regex to match each line, but don't get the good > > result with one regex to match both lines. > > > > Can you help? >

Re: Help me with a regex problem

2019-10-25 Thread Илья Рассадин
don't get the good result with one regex to match both lines. Can you help? Thanks, Maggie -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Help me with a regex problem

2019-10-25 Thread Maggie Q Roth
Hello There are two primary types of lines in the log: 60.191.38.xx/ 42.120.161.xx /archives/1005 I know how to write regex to match each line, but don't get the good result with one regex to match both lines. Can you help? Thanks, Maggie

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 them to do so.) > However

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://rakudo.org/. regards

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
gt; 0, 2*pi*au/year, 0, # Earth speed > 0, 2*pi*(au/year + 0.002*au/month), 0# Moon speed > ; > $t < .2; > ($t, @ABC) »+=« (.01, dABC($t, @ABC, .01)) > ) { > printf "t = %.02f : %s\n", $t, @ABC.fmt("%+.3e"

Re: Help with Perl 6 script

2019-08-12 Thread Bruce Gray
finitely just install Perl 6 as linked above. > Here's the script: —code snipped-- > I'm having problem specially in the "multi infix" and even in the "norm" sub > routine. The problem is that I do not understand the construction of these in > Perl

Help with Perl 6 script

2019-08-08 Thread Rui Fernandes
I'm having problem specially in the "multi infix" and even in the "norm" sub routine. The problem is that I do not understand the construction of these in Perl 5 (otherwise, I would translate this easely, and I wouldn't be asking for help...) Any help is apreciated. Clear skies Rui Fernandes

Re: Help with "install_driver(Oracle) failed" error message

2019-03-12 Thread Uri Guttman
.. Regardless,  I installed Strawberry Perl, 64 bit, and MOST everything is running “okay”.  I am getting the following error in one of our scripts (this was not a problem when Active State perl was installed): hi, i am sorry for your pain (in multiple dimensions! :). i can't help you but i

Help with "install_driver(Oracle) failed" error message

2019-03-12 Thread Frank K.
CLE_HOME is pointing to the 64 bit drivers so I am at a bit of a loss as to why it’s expecting a 32 bit dll. I have verified the dll is in that path. Any ideas? I’ve Googled a bit and can find a bunch of hacks but….Any help would be most appreciated.. flk k

Re: help with another regex

2018-07-17 Thread Lauren C.
I think reading the official tutorial from begin is not that comfortable to a newbie. I bought a book "Learning Perl, 6th Edition" for studying step by step. thanks. On 2018/7/18 星期三 AM 9:08, Uri Guttman wrote: also i always recommend reading the entire perl FAQ as there are many regex tips a

Re: help with another regex

2018-07-17 Thread Uri Guttman
On 07/17/2018 08:57 PM, Lauren C. wrote: I did read them, but got no deep impression unless I met the issue. :) not sure what kind of deep impression you need! :) a key thing with docs is rereading them. read them once quickly all the way through to get a sense of the whole picture. read aga

Re: help with another regex

2018-07-17 Thread Lauren C.
I did read them, but got no deep impression unless I met the issue. :) Uri Guttman 写道: On 07/17/2018 08:46 PM, Lauren C. wrote: Thanks Gil. I think i know the difference of "\w+" and "\w*" now. lauren, did you read the perlretut document? if not, you should. it covers quantifiers early on a

Re: help with another regex

2018-07-17 Thread Uri Guttman
On 07/17/2018 08:46 PM, Lauren C. wrote: Thanks Gil. I think i know the difference of "\w+" and "\w*" now. lauren, did you read the perlretut document? if not, you should. it covers quantifiers early on as they are one of the fundamental features of regexes. a key thing to learn is the {m,n}

Re: help with another regex

2018-07-17 Thread Lauren C.
, 2018 at 6:56 AM, Lauren C. <mailto:lau...@miscnote.net>> wrote: Hello, I want to match: /path/ /path/123 /path/abc but /path/?xxx  should not be matched. This works: $ perl -le '$x="/path/abc"; print 1 if $x=~m{path/\w+}' 1

Re: help with another regex

2018-07-17 Thread Lauren C.
r more of the previous thing. Quantifier + : one or more of the previous thing. So "/path/" won't match m{path/\w+} because this regex wants "one or more \w" at that position, which the string doesn't have. If you use m{path/\w*} (note the asterisk) then you'

Re: help with another regex

2018-07-17 Thread Andy Bach
want to match: > > /path/ > /path/123 > /path/abc > > but /path/?xxx should not be matched. > > This works: > > $ perl -le '$x="/path/abc"; print 1 if $x=~m{path/\w+}' > 1 > > > this works too: > > $ perl -le '$x="/path/?a

Re: help with another regex

2018-07-17 Thread Gil Magno
ier * : zero or more of the previous thing. Quantifier + : one or more of the previous thing. So "/path/" won't match m{path/\w+} because this regex wants "one or more \w" at that position, which the string doesn't have. If you use m{path/\w*} (note the asterisk) th

Re: help with another regex

2018-07-17 Thread Илья Рассадин
1 if $x=~m{path/\w+}' 1 this works too: $ perl -le '$x="/path/?abc"; print 1 if $x=~m{path/\w+}' But it doesn't work for this case: $ perl -le '$x="/path/"; print 1 if $x=~m{path/\w+}' it expects 1 returned. Can you help? thanks.

help with another regex

2018-07-17 Thread Lauren C.
sn't work for this case: $ perl -le '$x="/path/"; print 1 if $x=~m{path/\w+}' it expects 1 returned. Can you help? thanks. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

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
odern languages. it is hard to do any text or data processing without them. i recommend you read those tutorials mentioned earlier and possibly other materials. stay away from most 'perl' or 'regex' tutorials on the net as many are very poorly written and full of mistakes. and i

Re: help with a stat script

2018-07-12 Thread Lauren C.
Thanks John. Those symbols made me crazy entirely. As what you explained, some are metadata of regex, some are regular characters, it's not clear to me, due to my poor knowledge on regex. Yes I will learn them more. thanks. On 2018/7/13 星期五 AM 2:23, John W. Krahn wrote: On Thu, 2018-07-12 a

Re: help with a stat script

2018-07-12 Thread Lauren C.
'it matched' } This will not match, because there's no "whitespace" in the string. But this $name = "lauren"; if ($name =~ m{\S}) { print 'it matched' } will match, because in the string there is a character which is *not* "whitespace". For

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
On Thu, 2018-07-12 at 19:35 +0800, Lauren C. wrote: > > My web is powered by Apache and PHP,its access log seems as blow, > > xx.xx.xx.xx - - [12/Jul/2018:19:29:43 +0800] "GET  > /2018/07/06/antique-internet/ HTTP/1.1" 200 5489 "https://miscnote.ne > t/"  > "Mozilla/5.0 (Macintosh; Intel Mac OS X

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
; if ($name =~ m{\S}) { print 'it matched' } will match, because in the string there is a character which is *not* "whitespace". For the ^ [] and .*? in the regex, those pages I the previous email help you. Best gil > On 2018/7/12 星期四 PM 8:37, Илья Рассадин wrote: &g

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
ET (.*?/)\s+}; printf "%-20s%-40s%-40s\n",$1,$3,$2' > > I was totally confused about it. > what does m{...} and its content stand for? > Can you help give a explain? Hi, Lauren The m{...} is a regular expression (regexp). If you not familiar with regexps in Pe

Re: help with a stat script

2018-07-12 Thread Илья Рассадин
og/apache2/access.log|perl -nle 'next unless m{^(\S+) - - \[(\S+).*\] \"GET (.*?/)\s+}; printf "%-20s%-40s%-40s\n",$1,$3,$2' I was totally confused about it.  what does m{...} and its content stand for? Can you help give a explain? thanks in advance. -- To uns

help with a stat script

2018-07-12 Thread Lauren C.
ut it. what does m{...} and its content stand for? Can you help give a explain? thanks in advance. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Help debugging some old Bugzilla perl scripts

2018-02-26 Thread jose cabrera
On Monday, February 26, 2018 at 4:50 AM, Shlomi Fish" wrote... > Hi jose, > > please see http://www.shlomifish.org/Files/files/code/bugzilla.patch for my > patch against bugzilla 3.2 to get it to compile with recent perls. Thanks. josé -- What if eternity is real? Where will you spend it? H

Re: Help debugging some old Bugzilla perl scripts

2018-02-26 Thread Shlomi Fish
Hi jose, please see http://www.shlomifish.org/Files/files/code/bugzilla.patch for my patch against bugzilla 3.2 to get it to compile with recent perls. On Mon, 26 Feb 2018 05:43:45 +0100 "jose cabrera" wrote: > On Sunday, February 25, 2018 at 11:26 PM, "Uri Guttman" wrote... > > > > > > ==

Re: Help debugging some old Bugzilla perl scripts

2018-02-25 Thread Uri Guttman
On 02/25/2018 11:51 PM, jose cabrera wrote: On Sunday, February 25, 2018 at 11:48 PM, "Uri Guttman" wrote... Here is line 1085: foreach my $type qw(dependson blocked) { my @bug_ids = split(/[\s,]+/, $deps_in{$type}); put parens around the qw(). it used to be allowed as the ()

Re: Help debugging some old Bugzilla perl scripts

2018-02-25 Thread jose cabrera
On Sunday, February 25, 2018 at 11:48 PM, "Uri Guttman" wrote... > >>> Here is line 1085: > >>> foreach my $type qw(dependson blocked) { > >>> my @bug_ids = split(/[\s,]+/, $deps_in{$type}); > >> put parens around the qw(). it used to be allowed as the () in the for > >> loop but no

Re: Help debugging some old Bugzilla perl scripts

2018-02-25 Thread Uri Guttman
On 02/25/2018 11:43 PM, jose cabrera wrote: On Sunday, February 25, 2018 at 11:26 PM, "Uri Guttman" wrote... syntax error at Bugzilla/Bug.pm line 1085, near "$type qw(dependson blocked)" Here is line 1085: foreach my $type qw(dependson blocked) {

Re: Help debugging some old Bugzilla perl scripts

2018-02-25 Thread jose cabrera
On Sunday, February 25, 2018 at 11:26 PM, "Uri Guttman" wrote... > > > > > > syntax error at Bugzilla/Bug.pm line 1085, near "$type qw(dependson > > blocked)" > > > > Here is line 1085: > > foreach my $type qw(dependson blocked) { > > my @bug

Re: Help debugging some old Bugzilla perl scripts

2018-02-25 Thread Uri Guttman
h = Bugzilla->dbh; i don't see any obvious errors there. that implies it might be something before this. saying it is global makes me think the sub { is not opening a new sub so earlier may be something wrong. post a larger snippet and that may help. thanx, uri -- To unsubscribe,

Help debugging some old Bugzilla perl scripts

2018-02-25 Thread jose cabrera
Greetings! Long story, I had to install Bugzilla v3.2, which was in a WinNT 4. I have now installed Bugzilla v3.2, in the Ubuntu 14.04 server, but I have perl (v5.22.1) and I am getting lots of errors. Once I learn to fix one of these, I can work with the others. ===

Re: help check a piece of code

2017-04-10 Thread Andy Bach
On Sat, Apr 1, 2017 at 4:24 AM, K. Peng wrote: > I don't know why the "ref" and "scalar" functions here can be used to > validate if it's ASCII or UTF8 encoding. > > > use constant ASCII => ref eval { > require Encode; > Encode::find_encoding('ascii'); > }; > > use constant UTF8 =

help check a piece of code

2017-04-01 Thread K. Peng
can you help explain the code below? I don't know why the "ref" and "scalar" functions here can be used to validate if it's ASCII or UTF8 encoding. use constant ASCII => ref eval { require Encode; Encode::find_encoding('ascii');

Re: wickedcoolperlscripts help

2016-09-19 Thread Uri Guttman
On 09/19/2016 09:32 PM, derr...@thecopes.me wrote: I am working on the book Wicked Cool Perl Scripts as a learning tool to hely me get from beginner to intermmediate perl. The second script of the book is giving me lots of trouble. Notably the part below. I realize he creating a hash and is usi

wickedcoolperlscripts help

2016-09-19 Thread derrick
I am working on the book Wicked Cool Perl Scripts as a learning tool to hely me get from beginner to intermmediate perl. The second script of the book is giving me lots of trouble. Notably the part below. I realize he creating a hash and is using the $File::Find::name object which may be a bit o

Re: Wanted: Help performing Date-Time Arithmetic using emacs/vi and perl

2016-04-19 Thread Shlomi Fish
nd then execute the above VI/Ex command you get: > 4*atan(1))=3.14159265358979 > > > Here is my failed attempt to do date arithmetic: > (use Date::Calc ( ":all" ); use Date::Manip; my ( $date, $yy, $dd, $mm ); > $date = scalar localtime( ( time() - ( 24 * 60 * 60 ) )

Wanted: Help performing Date-Time Arithmetic using emacs/vi and perl

2016-04-18 Thread Richard Heintze via beginners
: (use Date::Calc ( ":all" ); use Date::Manip; my ( $date, $yy, $dd, $mm ); $date = scalar localtime( ( time() - ( 24 * 60 * 60 ) ) ); $date)="" Can someone help me figure out how to use the eval function in my perl one-liner to evaluate date time arithmetic? Thanks,Siegfried

Re: coding help

2016-03-01 Thread Shawn H Corey
On Tue, 1 Mar 2016 12:05:14 +0530 Arghya Das wrote: > $num = 1234; > $sum = 0; > > while ( $num != 0) > { > $rem = $num % 10; > $sum = ( $sum * 10 ) + $rem; > $num = $num / 10; $num = int( $num / 10 ); > } > > print $sum; > > > > please tell what is wrong with the reverse number code .

Re: coding help

2016-02-29 Thread Kent Fredric
On 1 March 2016 at 19:35, Arghya Das wrote: > $num = 1234; > $sum = 0; > > while ( $num != 0) > { > $rem = $num % 10; > $sum = ( $sum * 10 ) + $rem; > $num = $num / 10; > } > > print $sum; I suspect you're just exceeding precision limits. Modified code: use strict; use warnings; my $num = 1234

coding help

2016-02-29 Thread Arghya Das
$num = 1234; $sum = 0; while ( $num != 0) { $rem = $num % 10; $sum = ( $sum * 10 ) + $rem; $num = $num / 10; } print $sum; please tell what is wrong with the reverse number code . It prints Infinity.

Re: Counter Help

2016-02-12 Thread Kent Fredric
On 13 February 2016 at 10:08, Kent Fredric wrote: > > All you're doing is sorting the *view* of it. Not the data itself. If you want a demonstration of this fact, on a Linux filesystem, poke around with 'find'. Or if you've got Path::Iterator::Rule installed: perl -MPIR -E' $it = PIR->new->ite

Re: Counter Help

2016-02-12 Thread Kent Fredric
On 13 February 2016 at 08:38, timothy adigun <2teezp...@gmail.com> wrote: > In your analogy, if hashes are like folder, keys and values are like what? > Name of folders. If yes, can those be sorted? If yes, they you have just > made my point.. :) Keys are files. Values are file contents. B

RE: Counter Help

2016-02-12 Thread uri
On Fri, February 12, 2016 12:37 pm, Christin Deville wrote: > I have been lurking for a while but I want to chime in and say thanks for > that piece of advice. I've been trying to sort out in my head when to use > a hash or an array and this all helps! > > in real world code you should be using ha

Re: Counter Help

2016-02-12 Thread timothy adigun
On Feb 12, 2016 8:28 PM, "Kent Fredric" wrote: > > On 13 February 2016 at 07:39, timothy adigun <2teezp...@gmail.com> wrote: > > And hashes keys/values can't be sorted? Just saying.. :) > > > In my other message where I give an analogy to a "Folder" or > "Directory" in a file system. In your analo

Re: Counter Help

2016-02-12 Thread Kent Fredric
On 13 February 2016 at 07:39, timothy adigun <2teezp...@gmail.com> wrote: > And hashes keys/values can't be sorted? Just saying.. :) In my other message where I give an analogy to a "Folder" or "Directory" in a file system. Can you sort a folder? ... not really. They don't really have an "order"

Re: Counter Help

2016-02-12 Thread Kent Fredric
On 10 February 2016 at 03:46, James Kerwin wrote: > (I'm a bit wary of hashes because they're weird). If you want a nice way to reason about hashes when you're really new, there's something that you probably already understand you can borrow understanding from: Folders. A hash is like a folder

Re: Counter Help

2016-02-12 Thread timothy adigun
On Feb 12, 2016 6:22 PM, "Shawn H Corey" wrote: > > On Fri, 12 Feb 2016 12:08:07 -0500 > Uri Guttman wrote: > > > hashes are very easy to learn. and once you get the hang of them you > > will wonder why you waited so long. > > If keeping the data ordering is important, And hashes keys/values can'

RE: Counter Help

2016-02-12 Thread Christin Deville
riday, February 12, 2016 10:21 AM To: beginners@perl.org Subject: Re: Counter Help On Fri, 12 Feb 2016 12:08:07 -0500 Uri Guttman wrote: > hashes are very easy to learn. and once you get the hang of them you > will wonder why you waited so long. If keeping the data ordering is important, u

Re: Counter Help

2016-02-12 Thread Uri Guttman
On 02/12/2016 04:33 AM, James Kerwin wrote: Thank you all for your help; all suggestions were welcome and helpful. I didn't give the full details but Jim's solution did what I wanted the best and after reading around I think I get it. I've sat here trying to "break"

Re: Counter Help

2016-02-12 Thread Shawn H Corey
On Fri, 12 Feb 2016 12:08:07 -0500 Uri Guttman wrote: > hashes are very easy to learn. and once you get the hang of them you > will wonder why you waited so long. If keeping the data ordering is important, use an array. Otherwise, use a hash. :) -- Don't stop where the ink does. Shaw

Re: Counter Help

2016-02-12 Thread James Kerwin
Thank you all for your help; all suggestions were welcome and helpful. I didn't give the full details but Jim's solution did what I wanted the best and after reading around I think I get it. I've sat here trying to "break" it for the past half an hour and so far so g

Re: Counter Help

2016-02-09 Thread Jim Gibson
> On Feb 9, 2016, at 6:46 AM, James Kerwin wrote: > > Thank you both very much for your help. I'll investigate this way when I get > home later (I'm a bit wary of hashes because they're weird). Here is a solution using a hash: #!/usr/bin/perl use strict; us

Re: Counter Help

2016-02-09 Thread Shlomi Fish
tutorials/bad-elements/ (Note: perl-begin.org is a web site that I maintain.) Below is one comment on Duncan's code: > > > Here is some working code that may help > > === > > #!/usr/bin/perl > > use strict; > > use warnings; > > &

Re: Counter Help

2016-02-09 Thread Nathan Hilterbrand
On 02/09/2016 09:08 AM, James Kerwin wrote: Afternoon all, I have the following problem: I have an array containing a list of non-unique strings. eg: @array Contains: 11_ 22_ 33_ 33_ 33_ 44_ 44_ 55_ What I would like to do is number each element of the array

RE: Counter Help

2016-02-09 Thread Duncan Ferguson
I disagree – hashes are not weird – they are incredibly useful. It is just an array indexed by a word instead of a number ☺ Here is some working code that may help === #!/usr/bin/perl use strict; use warnings; my @array = ( qw/ 11_ 22_ 33_ 33_ 33_ 44_ 44_ 55_ / ); my %results

Re: Counter Help

2016-02-09 Thread James Kerwin
Thank you both very much for your help. I'll investigate this way when I get home later (I'm a bit wary of hashes because they're weird). As my files are sorted numerically I managed to do the following (it's ugly, please don't shout at me): my $length = (scalar @New)-1;

Re: Counter Help

2016-02-09 Thread Jing Yu via beginners
Hello, I don’t know whether it is possible to count the occurrence in hash? print $var, $myhash{$var}++.”\n”; Jing > On 9 Feb 2016, at 14:08, James Kerwin wrote: > > Afternoon all, > > I have the following problem: > > I have an array containing a list of non-unique strings. eg: > > @array

Re: Counter Help

2016-02-09 Thread Jim Gibson
> On Feb 9, 2016, at 6:08 AM, James Kerwin wrote: > > Afternoon all, > > I have the following problem: > > I have an array containing a list of non-unique strings. eg: > > @array Contains: > > 11_ > 22_ > 33_ > 33_ > 33_ > 44_ > 44_ > 55_ > > What I would lik

Counter Help

2016-02-09 Thread James Kerwin
Afternoon all, I have the following problem: I have an array containing a list of non-unique strings. eg: @array Contains: 11_ 22_ 33_ 33_ 33_ 44_ 44_ 55_ What I would like to do is number each element of the array to look as follows: 11_1 22_1 33_1

Re: XML Simple + parsing inner loop elements + help

2015-12-08 Thread perl kamal
Hi, Thanks you for your valuable comments,let me try the Twig module. On 12/8/15, Kent Fredric wrote: > On 8 December 2015 at 19:25, perl kamal wrote: >> I am trying to parse the inner loop elements of the attached input xml >> elements. >> The below code doesn't retrieve the inner loop() eleme

Re: XML Simple + parsing inner loop elements + help

2015-12-08 Thread shawn wilson
tl;dr I'm not answering your specific question here. On Dec 8, 2015 1:26 AM, "perl kamal" wrote: > > Hi, > > I am trying to parse the inner loop elements of the attached input xml elements. Just fyi, I've found it easier to use xslt as an etl preprocessor to perl. I'm not sure how you intend to

  1   2   3   4   5   6   7   8   9   10   >