Re: Easiest Way in Perl to check Whether a Disk is Mounted
I sure couldn't figure out how to test for a mount with that module. And I did go to 'man 2 mount'. Still couldn't figure it out. Mike On 6/1/24 18:29, Jeff P via beginners wrote: Of course, I can use system calls and call the unix mount or mountpoint applications but is there a proper perl way to do this since system calls are not as elegant? Thank you. How about this module from metacpan? https://metacpan.org/pod/Sys::Linux::Mount regards.
Re: [announcements mailing list]
I am subscribed to the Perl Weekly: https://perlweekly.com/ Mike On 3/15/24 06:27, Maxim Abalenkov wrote: Dear all, How are you? I hope all is well with you. I’m wondering, do we have some kind of an announcements mailing list, that would highlight, what happened in the Perl world over the past week, month, quarter? What are the new developments, when a new version of Perl will be available or released? It would be nice and pleasant to know. Thank you and have a wonderful Friday ahead! — Best wishes, Maxim Maxim Abalenkov \\ maxim.abalen...@gmail.com +44 7 486 486 505 \\ www.maxim.abalenkov.uk
Re: [install and use local::lib module]
Hello Maxim, I say $HOME/perl5 (~/perl5) is where my personally installed modules are located. Actually in ~/perl5/lib/perl5/ I am less sure about $HOME/.cpan (~/.cpan), but I think that is where the cpan settings are stored. But looking inside it suggests it is more than just settings. Mike F. Houston, TX On 2/15/24 04:23, Maxim Abalenkov wrote: Dear all, How are you? I re-read the README file of the local::lib module. There was one more command missing: echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >>~/.bashrc My new Perl settings in the .profile file are: # Perl 5.38 export PATH=/usr/local/bin:$PATH export PERL5LIB=$HOME/perl5/lib/perl5 eval `perl -I$HOME/perl5/lib/perl5 -Mlocal::lib` Now everything works. But I still don’t understand the setup very well. What is the difference between the ‘.cpan’ and ‘perl5’ directories? What is their purpose? Thank you and have a great day ahead! — Best wishes, Maxim Maxim Abalenkov \\ maxim.abalen...@gmail.com +44 7 486 486 505 \\ www.maxim.abalenkov.uk
Re: https://metacpan.org/pod/OpenOffice::OODoc
I don't. Mike On 1/31/24 16:51, hw wrote: Ok and how do you do it with OpenOffice::OODoc? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: https://metacpan.org/pod/OpenOffice::OODoc
FWIW, in Spreadsheet::WriteExcel I do this: $sheet = $book1 -> worksheets(2) -> {Name}; $sheet = $book1 -> worksheets($sheet); $sheet -> Activate; $sheet -> Range("B2") -> Activate; $ex -> ActiveWindow -> {FreezePanes} = "True"; Mike On 1/28/24 16:26, hw wrote: So how do I freeze rows/columns? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: https://metacpan.org/pod/OpenOffice::OODoc
It can be done with a Perl module: https://unix.stackexchange.com/questions/723650/editing-libreoffice-calc-spreadsheets-in-the-terminal I have not tested that. Mike On 1/25/24 13:05, hw wrote: Hi, is there a way to create libreoffice spreadsheets (ods) similar to Excel::Writer::XLSX? There is OpenOffice::OODoc and I don't see how to create spreadsheet documents with that. Is there still no way to do that? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: regex
I stand properly scolded. Mike On 1/23/24 07:01, k...@aspodata.se wrote: Please stop using my mail address when replying, I'm on the list and don't want two copies of the same mail (it's not about you Mike). -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: regex
Why is my Perl not working on that command? $ perl -e 'exit(10) if "aaa"=~/a{,2}/;' Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/a{ <-- HERE ,2}/ at -e line 1. $ But this works: $ perl -e 'exit(10) if "aaa"=~/a{0,2}/;' $ $ echo $? 10 $ It sure surprised me that the first one did not work for me. Do I need to upgrade my Perl? $ perl -v This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux (with 1 registered patch, see perl -V for more detail) snip $ I just went through my Perl documentation and none of it allows {,2}. Learning Perl Second Edition (July 1997) says: "If you leave off the second number, as in /x{5,}/, it means "that many or more" (five or more in this case), and if you leave off the comma, as in /x{5}/, it means "exactly this many" (five x's). To get five or less x's, you must put the zero in, as in /x{0,5}/." Mike On 1/22/24 06:23, Jorge Almeida wrote: Please help me to understand this: $ perl -e 'exit(10) if "aaa"=~/a{,2}/;' $ echo $? $ 10 Thanks Jorge Almeida
Re: Knowledge for a basic programmer and advanced programmer
If you are coding you should be backing up every 10 minutes or more often. And you should store a "historical" full copy of the code every 30 minutes or more often and save them for days. Mike On 1/2/24 10:33, William Torrez Corea wrote: On Tue, Jan 2, 2024 at 5:17 AM Shlomi Fish wrote: On Sat, 16 Dec 2023 08:10:49 -0600 William Torrez Corea wrote: > What needs to know a basic and advanced programmer? > > I am a basic programmer, I don't have enough experience to be an advanced > programmer. > > How many years of experience must an advanced programmer have? > hi William, I answered many of your questions in the FAQs I comaint. List here: https://www.shlomifish.org/meta/FAQ/which_faqs_do_you_comaint.xhtml -- Shlomi Fish https://www.shlomifish.org/ Parody of "The Fountainhead" - https://shlom.in/towtf Golden rule #12: When the comments do not match the code, they probably are both wrong. ;) — Steven Rostedt, https://lwn.net/Articles/433900/ Please reply to list if it's a mailing list post - https://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ My projects had a lot of compiler errors and I lost time. A long time ago I used Borland Turbo C, an IDE out-of-time until today. My colleague lost time with this IDE because delete code, so he had to code it again from scratch. Actually i use: 1. gcc version 12.2.0 (Debian 12.2.0-14) 2. vim version 9.0.1499 3. GNU gdb (Debian 13.1-3) 13.1 4. GNU Make 4.3 5. git version 2.39.2 /Actually I have problems with the logic, the syntax is closed matter and I can't work in a team. / -- With kindest regards, William. ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org ⠈⠳⣄
Re: [getting PAUSE account]
That is true. I don't see the appeal with Python, but I have barely dabbled in it. I code for me and I know Perl. I don't have the motivation to learn a new language. Perl works well, so I use it. Mike On 12/25/23 22:05, William Torrez Corea wrote: I am a beginner, I am learning of the book Beginning Perl by Curtis "Ovid" Poe. I am learning subroutines. I want to develop a program or work in a project where the people use Perl but the majority of projects are developed in Java or C#. -- With kindest regards, William. ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org ⠈⠳⣄
Re: [getting PAUSE account]
Great question. I think I did see that Pause accounts were going away soon, but I'm not sure that has taken place yet. I just signed into my Pause account and I don't see anything about them being retired. This 3 year old post says it takes a bit of time: https://www.reddit.com/r/perl/comments/l1n0q2/questions_about_pause_account/?rdt=41813 Do you plan to create a module for CPAN? I'm just wondering. Perl is still going strong, though you might not think so from what you see. I use it all day - every day. Mike Houston, TX On 12/23/23 10:01, Maxim Abalenkov wrote: Dear all, How are you? I hope all is well with you. I’m reading the ‘Intermediate Perl’ textbook. It suggests applying for a PAUSE account. I applied a couple of days ago using the link listed in the book. However, I still haven’t received any reply. Am I doing something wrong? Shall I be more patient or is the advice in the book no longer relevant? Please let me know. Thank you and have a good day ahead! -- Best wishes, Maxim Maxim Abalenkov \\ maxim.abalen...@gmail.com +44 7 486 486 505 \\ www.maxim.abalenkov.uk
Re: Upgrade Perl
I use https://perlbrew.pl/ Best regards, Mike On 10/5/23 21:03, William Torrez Corea wrote: How to upgrade Perl from Debian? I have Perl *v5.32.1* -- With kindest regards, William. ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org <https://www.debian.org> ⠈⠳⣄
Re: My progress in Perl
"Try to learn by doing something that you need." That is great advice. Write a program to open your directories given a key word. I use that program dozens of times every day. Mike On 8/7/23 00:29, Olivier wrote: William, I started testing some extensions of CPAN but I don't understand anything. I only execute and then proceed with a book. The name of the book is Beginning Perl of Curtis Ovid Poe. I started with a lot of passion but then lost interest, the monotony conquered me. Actually I am learning references and Complex Data Structures in Perl. I never learned that in Perl and I have been using Perl for 25 years at least. I never learned Perl from a book either, I used it for some small tasks/projects and learned new bits when I needed them. I have a lot of doubts in my mind: What is my purpose with this language? For me, Perl is an unvaluable tool for automatisation of system tasks, manage users, create accounts, etc. My last scripts are used to synchronize print quota between two very dissimliar systems. In my country don't exist use of this language I am boring and tired SpamAssassin is a large project in Perl, but even that is not using very complicated data structures. Perl was designed to manipulate reports, extract data and create new reports. It is not a general usage language. I am not sure it is the right way to try to learn Perl without any project. Try to learn by doing something that you need. Most of the CPAN extensions (modules), you don't need them, you will never need them unless you have a direct use for them. Also, depending on the operating system you are using, some of the Perl modules may be part of the packages distriubuted for your OS. Also, for me the real strength of Perl is the strong system of regular expressions, I have an extensive use for them in each of my scripts (a software produces some logs, I have to extract some significant lines from the logs, etc.) Best regards, Olivier
Re: hosting suggestion?
I used HostGator for more than 10 years, but they lost much of their expertise during Covid. I am on A2-hosting now. I think they are expensive, but pretty good. Mike On 7/1/23 13:49, Rick T wrote: My web hosting company is closing business, and I less than two weeks to move my five sites to another host. All of these use perl. If you have experience with a host that supports perl, I’d appreciate any and all suggestions. I’m less concerned with cost than with service quality and support because I’m a high school teacher rather than a web professional! Thanks in advance! Rick Triplett
Re: Communities or support
Good question. I know we are using it here in the USA. I put in my time on Perl, and now I can whip up a program mighty fast. I do so quite often. And I use it every day - many times a day. Mike On 6/14/23 17:44, William Torrez Corea wrote: Why don't existing communities, use or support the language of programming PERL in Central America? What happened? Why does nobody use this language of programming in this continent? Only JavaScript, Java, .NET, Python and other frameworks are promoted and used in this continent. -- With kindest regards, William. ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org ⠈⠳⣄
Re: providing perl api for C library
I don't know. You know what they say - to get the quickest answer, don't ask the question. Instead, do it wrong and people will come out of the woodwork to tell you your an idiot :-) Mike On 12/9/22 21:19, Henry R wrote: Hello list, I have written a C library which encrypts the data stored in object storage like S3. If I want to provide it with a perl OO interface what's the right way? such methods like: $data->encrypt("input.sth"); $data->decrypt("input.sth"); Thanks.
Re: Iterating over Arrays
Your version produces this output in Perl 5.30.0: this that Use of uninitialized value $element in concatenation (.) or string at trash.pl line 14. Use of uninitialized value $element in concatenation (.) or string at trash.pl line 14. Use of uninitialized value $element in concatenation (.) or string at trash.pl line 14. bad idea Which is what I would expect. Another version: use strict; use warnings; my @words = ("this","that"); $words[5] = "bad idea"; for my $element (@words){ if (defined $element) { print "$element\n"; } else { print "undefined\n"; } } print "\a"; __END__ Output: this that undefined undefined undefined bad idea Mike On 9/24/22 20:00, William Torrez Corea wrote: What happen with my code? use strict; use warnings; use diagnostics; my @words = ("this","that"); # With this code $words[5] = "bad idea"; for my $element (@words){ print "$element\n"; } ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ "words.pl" 13L, 167B 1,1 All Use of uninitialized value $element in concatenation (.) or string at words.pl line 11. at words.pl line 11.
Re: How to can develop a program
I agree. Roadmap is good. I even gave him a starting roadmap, but I think he is just looking for the answer. Which means he is going to be disappointed for sure. Mike On 8/2/22 03:41, Ruprecht Helms (privat) wrote: for bigger developing-project the best thing is a roadmap, because you have to plan the steps what the thing should do. Start with a sheet of paper and a pencil and after that you can decide what programminglanguage to use and which module you want to start first. Regards, Ruprecht Am 02.08.22 um 10:07 schrieb Christian Walde: On Mon, 01 Aug 2022 22:50:21 +0200, William Torrez Corea wrote: On Mon, Aug 1, 2022 at 8:16 AM Christian Walde wrote: On Sat, 23 Jul 2022 21:03:18 +0200, William Torrez Corea < willitc9...@gmail.com> wrote: My goal: I want to create you should start [...] reading Modern Perl and Ovid's Beginning Perl. Do you have some roadmap that I can follow?
Re: How to can develop a program
I'm going to be traveling, so will not be able to help much in the next 2 days. That is a PDF file you supplied. Is it fair to say you want to be able to search for all the names listed in a text file and be able to print out which file contains which name. And in some cases the name will not be in any of the files? Is that the goal? Define your goal and we will help you. The file below is a bit old, but maybe it works for your PDF files. I have not tested it on your url. I gather you don't have HTML tables, so maybe it is not for your case. Mike #!/usr/bin/perl -w # # # This program writes the results of the webpage listed in line 17 # to $outfile. So basically it converts HTML to text. # It works reasonably well with HTML tables. # # #!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; use HTML::FormatText::WithLinks::AndTables; my $page = 'http://www.mflan.com/crime.htm'; my $outfile = 'output.txt'; chdir '/home/mike/Documents/copy'; open OUT, ">>$outfile" or die "Can't open '$outfile': $!"; my ($sl, $request, $response, $html); $sl = LWP::UserAgent->new; $sl->proxy('http', ''); # enter proxy if needs be / and set it for Soap too ... $request = HTTP::Request->new('GET', $page); $response = $sl->request($request); $html = $response->as_string; print "Got it into \$html.\n"; my $text = HTML::FormatText::WithLinks::AndTables->convert($html); print OUT "$text"; print "\nAll done.\n"; close OUT; __END__ On 7/20/22 10:13, William Torrez Corea wrote: The url of the page: https://www.pgr.gob.ni/PDF/2021/GACETA/GACETA_17_08_2021.pdf On 7/20/22, William Torrez Corea wrote: Exist a page where you put info about the person but if you want to search a name you must search this manually. So, I want to automate this process with perl. -- With kindest regards, William. ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org ⠈⠳⣄
Re: Which distribution of PERL to use
Strawberry Perl would be my preference if it works. Mike On 7/4/22 19:52, Mr. Faiz Ul Haq Zia wrote: Hello, Which one of the PERL distribution should I use on windows 11. regards Faiz ul haque Zeya Senior Associate professor BUKC
Re: Fwd: Win32::OLE merge rtf files - table structure missing
Thank you. I received a small file: "source.rtf" and a larger 1.9 MB file: "source.RTF". "source.RTF" has a table and graphic graphs - 2 pages total. "source.rtf" is just 2 pages of ASCII text, with an ASCII table: ┌┬───┬───┬─┬ │ Fetal_Biometry │ Diameter(cms) │ Growth(%) │ Gestational_Age │ ├┼───┼───┼─┼ │BPD │2.44cm │35.57% │14w1d│ ├┼───┼───┼─┼ │HCD │9.08cm │20.90% │14w1d│ └┴───┴───┴─┴ I can serve up those files on my website if anybody else comes along and wants to see them. I gather the comments section at the bottom of "source.rtf" is this part: - Limitations of Obstetrics ultrasound scanning : - *Although a structural screening scan is undertaken, detection of structural anomalies will never be 100%. Detection rates vary and may be reduced by factors like maternal obesity, abdominal scars, gestation age, inappropriate fetal position and reduced amniotic fluid volume. Even in the best of hands, a small percentage of fetal anomalies will remain undetected. Internationally accepted detection rate of major abnormalities is around 70%. As this is a level I obstetric scan center. To the extent visualized no gross sonographically congenital anomalies could be detected in the present study and fetal position. However not all anomalies could be rule out. To rule out cardiac anomalies fetal echo is suggested. Sometimes fetal parts could not be seen in advanced stage of pregnancy and due to poor or inadequate acoustic window. Sometimes not all four limbs can be clearly visualized due fetal position and acoustic window. This has been clearly explained to the patient. So what is the problem? It sounds to me like you have everything completed that you want to do. Mike On 6/14/22 23:00, perl kamal wrote: Hi Mike, Greetings!!! Please find the attached source.rtf file. I have been trying to parse the rtf file and extract a few clinical measurements data and update that information in a formatted way in the comments sections which is at the bottom of the file. The script what I have been developed so far , 1. Parses the rtf file, writing the raw content into a temp file. 2. Extracting the required data into a temp file1. 3. Formatting the required data ( table structure) into a temp file2 4. Merges the formatted data from temp2 into the source rtf file at the end(expectation is to add at the comments section which is at the bottom of the file) Please let me know if you have any questions or clarifications. Your comments will be much appreciated and thankful . Regards, Kamal.
Re: Win32::OLE merge rtf files - table structure missing
There are a bunch of steps there. When you say "construct a table" - in what format? Is the finished product an html file? Do you know how to parse the rtf file already? If not, send an rtf file to me at te...@mflan.com I have attached a file to see if the list accepts attachments. Mike On 6/14/22 00:26, perl kamal wrote: Hi, Greetings!!! I am trying to process an rtf file , get the content from a paragraph,construct a table with the processed data and update it at the "Comments:'' table which is at the end of the file. My expected table structure is not updated while merging the contents. Your comments/suggestions will be much appreciated.Thanks. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Can use perl for download photos from facebook?
I don't use FB at all, but it's clear they spend a lot of their resources obfuscating their website. They provide a tool for backing up your FB wall, or whatever it is called, but the tool is not effective and reliable. I'm sure there are people overcoming this obfuscation, and then FB changes their site to obfuscate it again. Here is one example of people overcoming the FB obfuscation, and then FB changes their site to obfuscate it again: https://gist.github.com/zmwangx/6bb9ddb5d904b7275c62 I don't use FB because I don't like their rules. Mike On 3/19/22 22:25, William Torrez Corea wrote: So, friend? On Sat, Mar 19, 2022 at 8:23 PM Adam Hopkins wrote: I mean the Facebook.html file that you are scanning On Sat, Mar 19, 2022 at 9:17 PM William Torrez Corea wrote: Here is the short code: https://gist.github.com/adipasquale/2217595 On Sat, Mar 19, 2022 at 8:10 PM Adam Hopkins wrote: Did you download Facebook.html and already have it sitting on your computer? Can you upload that to a gist and share it here? On Sat, Mar 19, 2022 at 8:48 PM William Torrez Corea wrote: I have a short code: #!/usr/bin/perl; @ARGV = ("Facebook.html"); while(<>){ while(/(http[a-z\-\.0-9:\/]*\w*)_a.jpg/g){ print "wget $1_n.jpg\n"; } } But the result expected is null. I don't know why. On Sat, Mar 19, 2022 at 7:21 AM Jim Gibson wrote: Check out the LWP library of modules on CPAN: <https://metacpan.org/pod/LWP> > On Mar 19, 2022, at 6:07 AM, William Torrez Corea wrote: > > I have an idea from the program but I don't know where to start. > Jim Gibson
Re: threds question with Tk
If nobody responds, please supply a stripped down version of the script that produces the problem. Maybe get rid of use threads; use threads::shared; use IO::Socket::INET; Mike On 12/14/20 7:00 AM, stefano cerbioni wrote: hi guys i have created a script because i want a listbox and inside of them i want visualize a stream data , i understand for do that is necessary use threads first create a stream and second manages a Tk the problem is in Tk listbox appear only one time a data stream why ??, if anyone have some idea is welcome thanks at all this is a my code (perl 5 strawbaerry in windows 10 64bit ) use threads; use threads::shared; use Perl::Tidy; use Tk; use Tk::LabFrame; use Tk::ROText; use strict; use IO::Socket::INET; my$x:shared=1; my$data :shared; my@workerThreads; my@otherThreads; push@workerThreads , threads->create (\&threadSub1) for (1..10); push@otherThreads , threads->create (\&threadSub2) ; $_->join() for@workerThreads ; $_->join() for@otherThreads ; print("$x\n"); subthreadSub2 { my$mw = MainWindow->new ; $mw->geometry( "600x600" ); my$lbox = $mw->Listbox(-height =>500, -width =>500)->pack(); $lbox->insert('end', $data ); MainLoop; } subthreadSub1 { # auto-flush on socket $| = 1; # creating a listening socket my$socket = new IO::Socket::INET ( LocalHost => '127.0.0.1', LocalPort => '23456', Proto => 'tcp', Listen => 5, Reuse => 1 ); die"cannot create socket $!\n"unless$socket; print"server waiting for client connection on port 23456 \n"; while(1) { # waiting for a new client connection my$client_socket = $socket->accept(); # get information about a newly connected client my$client_address = $client_socket->peerhost(); my$client_port = $client_socket->peerport(); print"connection from $client_address:$client_port\n"; # read up to 1024 characters from the connected client #my $data = ""; $client_socket->recv($data, 1024); print"received data: $data\n"; my@data_array = split(/;/,$data); foreach (@data_array) { return"$_\n"; print"$_\n"; } # write response data to the connected client $data = "ok"; $client_socket->send($data); # notify client that response has been sent shutdown($client_socket, 1); } $socket->close(); }
Re: question about stream data and tk
I'm thinking that is not easy - maybe not possible. I hope you prove me wrong. Mike On 12/9/20 6:52 AM, stefano cerbioni wrote: hi guys i have a question is possible insert in listbox a TCP ipStream ? Does anyone have some examples about it ?? because I don't know where to start thanks -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: perl-5.32.0 - Failed test ''S' is set in PERL_UNICODE, or in -C, honor it, utf8 should be on'
You might be new at Perl, but obviously not at advance computer topics. This must be a hard question, because nobody is stepping forward with answers. I'm pretty sure this is a bad idea: https://www.thegeekstuff.com/2013/06/cpan-force-install-perl-module/ but I wanted to present it as a bad option. So we are saying that Perl v5.32.0 would not install on your machine. Maybe I should stick with my Perl v5.30.0 Mike On 9/27/20 11:25 PM, Robbi Nespu wrote: Hello everyone, I am new with perl. My test server are using SLES11SP4 and it already EOL. The latest openssl I can get from official repos it too old $ openssl version OpenSSL 0.9.8j-fips 07 Jan 2009 I plan to update with newer openssl # cd /usr/local/src/openssl-1.1.1h # ./config Wl,enablenewdtags prefix=/usr/local/ssl openssldir=/usr/local/ssl Operating system: x86_64-whatever-linux2 Perl v5.10.0 required--this is only v5.8.8, stopped at ./Configure line 12. BEGIN failed--compilation aborted at ./Configure line 12. Perl v5.10.0 required--this is only v5.8.8, stopped at ./Configure line 12. BEGIN failed--compilation aborted at ./Configure line 12. This system (linux-x86_64) is not supported. See file INSTALL for details. so.. seem I need to update perl (here i come) # cd /usr/local/src/ # wget https://www.cpan.org/src/5.0/perl-5.32.0.tar.gz # tar -xvzf (/usr/local/src/.tar.gz # cd perl-5.32.0 # sh Configure -de -Dusethreads # make # make test . . . cpan/Test-Simple/t/Test2/modules/Formatter/TAP . # Failed test ''S' is set in PERL_UNICODE, or in -C, honor it, utf8 should be on' # at t/Test2/modules/Formatter/TAP.t line 65. # Failed test 'IO handle stuff' # at t/Test2/modules/Formatter/TAP.t line 93. FAILED at test 1 . . Failed 1 test out of 2553, 99.96% okay. ../cpan/Test-Simple/t/Test2/modules/Formatter/TAP.t ### Since not all tests were successful, you may want to run some of ### them individually and examine any diagnostic messages they produce. ### See the INSTALL document's section on "make test". ### You have a good chance to get more information by running ### ./perl harness ### in the 't' directory since most (>=80%) of the tests succeeded. ### You may have to set your dynamic library search path, ### LD_LIBRARY_PATH, to point to the build directory: ### setenv LD_LIBRARY_PATH `pwd`; cd t; ./perl harness ### LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH; cd t; ./perl harness ### export LD_LIBRARY_PATH=`pwd`; cd t; ./perl harness ### for csh-style shells, like tcsh; or for traditional/modern ### Bourne-style shells, like bash, ksh, and zsh, respectively. Elapsed: 1567 sec u=15.41 s=3.92 cu=967.80 cs=74.34 scripts=2553 tests=1220626 make: *** [test] Error 1 at this point I have no idea where to check and fix it. checking ../cpan/Test-Simple/t/Test2/modules/Formatter/TAP.t but I don't understand. Could you give me some advice? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Error when using the executable perl in client machine
Hi Manikandan, I just received this response on the PAR list: Forwarded Message Subject:Re: Par with strawberry-Perl Date: Sat, 25 Apr 2020 09:44:13 +1000 From: Shawn Laffan To: Mike Flannigan CC: p...@perl.org Hello Mike, There are likely missing DLLs that need to be added to the pp call using the --link option. Finding these manually can be a pain, so have a look at pp_autolink or pp_simple (the former is mine, but adapted from the latter). https://github.com/shawnlaffan/perl-pp-autolink https://www.perlmonks.org/?node_id=1148802 Shawn. On 4/17/20 12:00 PM, Manikandan Narayan wrote: Hi We are using strawberry-perl Error when using the executable perl in client machine that does not have strawberry-perl in it Can't load 'C:\Users\Nuser\AppData\Local\Temp\par-30303030313137\cache-3610486 8c73148db1c60163c6ec837fe6a3b7c0d\9c557319.xs.dll' for module Net::SSH2: load_file:The specified module could not be found at /DynaLoader.pm line 193. at /PAR/Heavy.pm line 140. Compilation failed in require at C:\Users\ Nuser\AppData\Local\Temp\par-3030303 0313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/ Backend/Net_SSH2.pm line 15. BEGIN failed--compilation aborted at C:\Users\ Nuser \AppData\Local\Temp\par-30303030313137\cache-36104868c73148db1c60163c6ec837fe6a3b7c0d\inc\lib/Net/SFTP/Foreign/Backend/Net_SSH2.pm line 15. Compilation failed in require at script/SFTPdownload.pl line 13. BEGIN failed--compilation aborted at script/SFTPdownload.pl line 13. Any Help will be highly appreciated. Regards, Narayan
Problem with interaction of open3, sysread and DBI (pg)
I have a strange issue with sysread and postgres (and ffpeg/stderr) If the main program throws an error sysread stops if I write to the database (a log table) this is the program (need open3 because ffmpeg writes to stderr not stdout) use IPC::Open3; my($file,$in, $out); my $pid; use Symbol 'gensym'; $file = gensym; if ($soptsr->{command}=~/ffmpeg/){ $pid=open3(undef, undef, $file,$soptsr->{command}, @{$soptsr->{optsin}});# or die print "$!"; } our $tag= Glib::IO->add_watch ( fileno($output), ['in', 'hup'], sub { #local $SIG{__WARN__} = sub {}; my ($fileno, $condition,$tag) = @_; if ($condition =~ /hup/) { close $file; Gtk3->main_quit(); return 1; } my $line ; sysread $output, $line, 256 or die print $!; my @line=split /\n/,$line; foreach my $l (@line){ print $DBI::err,"\n";#,$ins->{errstr},"\n"; #print $condition,"\n"; #$ins->execute($soptsr->{transref},$soptsr->{fileid},$l);# if $l; } print "\n",$condition,"\t",$line,"\n";### this stops if I write todb with prog error return 1; } ); } This is the output [ in ] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/srv/data/Downloads/xx.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 Duration: 01:06:48.30, start: 0.00, bitrate: 237 kb [ in ] /s Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 426x240, 201 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default) Metadata: handler_name: VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x613470 [ in ] 6D), 24000 Hz, mono, fltp, 32 kb/s (default) Metadata: handler_name: VideoHandler ### If I write to db output stops here ### ### If I dont the output continues ### [ in ] Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame)) Press [q] to stop, [?] for help [ in ] [AVFilterGraph @ 0x55b6655bf800] No such filter: '-setpts' [ in ] Error reinitializing filters! Failed to inject frame into filter network: Invalid argument Error while processing the decoded data for stream #0:0 [ in ] Conversion failed! Any ideas? (I have fixed the error in the program, but I need to be able to log if I have other errors)
Re: reading data from a web site
I think so: https://stackoverflow.com/questions/11501883/wwwmechanize-work-with-javascript Well, maybe not: https://itworkarounds.blogspot.com/2011/07/automate-web-clicks-in-perl-with.html Maybe this is better - maybe it isn't: https://metacpan.org/pod/WWW::Scripter::Plugin::JavaScript Mike On 11/20/19 12:52 PM, hw wrote: The web site seems to be created by a program running on the server, i. e. there is not really a web site. When I access it with lynx or with WWW::Mechanize, the answer from the server says that neither frames, nor javascript is supported, and it is not possible to log in. Can WWW::Mechanize somehow trick the server into assuming that frames and javascript are supported by the client? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
regular expression
You are not doing anything with $t to test whether it works. Also you are not telling us what data you might test it with. Mike On 9/8/2019 6:41 PM, Jim Gibson wrote: On Sep 8, 2019, at 3:39 PM, Mike wrote: I expect it to return a positive value if $t contains a number anywhere within it and put that number in the $1 capture variable. On 9/8/2019 4:34 PM, Jim Gibson wrote: On Sep 8, 2019, at 1:30 PM, Gautam Desai wrote: Do you guys have any pointers ? $t =~ m{ ( # capture matched number in $1 \d* # match zero or more decimal digits [05] # followed by a '0' or '5' ) # end of capture (?: # followed by either: \D# a non-digit | # or $ # the end of the string ) }x -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ Jim Gibson j...@gibson.org -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Hi Folks : I'm trying to create a regular expression for finding a # wishing a dataset for only a number that is a multiple of 5
It's probably best if you write a short script that reads a __DATA__ section of data. Then tell us what it does and what you expected it to do. Off hand I don't see anything wrong with your regex, but I don't know what you expect it to do. Mike On 9/8/2019 4:34 PM, Jim Gibson wrote: On Sep 8, 2019, at 1:30 PM, Gautam Desai wrote: Do you guys have any pointers ? $t =~ m{ ( # capture matched number in $1 \d* # match zero or more decimal digits [05] # followed by a '0' or '5' ) # end of capture (?: # followed by either: \D# a non-digit | # or $ # the end of the string ) }x -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: symlink to "pack"
Maybe you should simplify to: #!/usr/bin/perl use strict; use warnings; symlink('ab', "foo") || die $!; If that doesn't work try it after changing 'symlink' to 'link' Printing your $target gives a space and this symbol: https://www.fileformat.info/info/unicode/char/2640/index.htm I am on Strawberry Perl, so I can't really help debug this. Mike On 9/7/2019 3:25 PM, Jorge Almeida wrote: Sorry about the title, it's the best I can do... #!/usr/bin/perl use strict; use warnings; my $num=12; my $target=pack('n', $num); symlink($target, "foo") || die $!; It dies with "No such file or directory" No symlink is created. What I want is a symlink named "foo" pointing to a 2-byte string. Yes, it would be a broken symlink. (Yes, this is how I want it). Symlink() can create broken links, the problem is the target. What to do? (And why doesn't it work?) TIA Jorge Almeida -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Geo::WebService::Elevation::USGS
This one gives: Unable to get page at httpfetch.pl line 35. I wonder if all of these are redirects: # Does not work my $test = get('https://nationalmap.gov/epqs/') or die 'Unable to get page'; # Does not work #my $test = get('https://nationalmap.gov/epqs/pqs.php') or die 'Unable to get page'; # Does not work #my $test = get('http://www.wrh.noaa.gov/zoa/mwmap3.php?map=usa') or die 'Unable to get page'; # Does not work #my $test = get('http://www.glorecords.blm.gov/') or die 'Unable to get page'; # Does not work #my $test = get('https://glorecords.blm.gov/default.aspx') or die 'Unable to get page'; # Does not work Mike On 9/2/2019 12:31 AM, Olivier wrote: Mike writes: Yes. Both of these work fine: my $test = get('http://google.com/') or die 'Unable to get page'; # Works my $test = get('https://google.com/') or die 'Unable to get page'; # Works Good, do we know two things: - your LWP::Simple is correctly installed - you have no proxy Next step is to see what is the result of https://nationalmap.gov/epqs/ So you should try with (note the / at the end): my $test = get('https://nationalmap.gov/epqs/') or die... Problem is that it is going through redirections and beacuase it is encrypted, it is almost impossible to debug by hand. Olivier On 8/29/2019 9:33 PM, Olivier wrote: Mike writes: Sorry Mike, but I have hard time to get a clear picture of what you are saying. Did you manage to use LWP::Simple to load google.com? Yes. Both of these work: my $test = get('http://google.com/') or die 'Unable to get page'; # Works my $test = get('https://google.com/') or die 'Unable to get page'; # Works This is really the first question, the first step to build the diagnostic. So far, I cannot even decide whether the version of LWP::Simple installed on your machine is properly working or not. So I cannot decide whether it is a network problem or a software problem. Best regards, Olivier -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Geo::WebService::Elevation::USGS
Yes. Both of these work fine: my $test = get('http://google.com/') or die 'Unable to get page'; # Works my $test = get('https://google.com/') or die 'Unable to get page'; # Works On 8/29/2019 9:33 PM, Olivier wrote: Mike writes: Sorry Mike, but I have hard time to get a clear picture of what you are saying. Did you manage to use LWP::Simple to load google.com? Yes. Both of these work: my $test = get('http://google.com/') or die 'Unable to get page'; # Works my $test = get('https://google.com/') or die 'Unable to get page'; # Works This is really the first question, the first step to build the diagnostic. So far, I cannot even decide whether the version of LWP::Simple installed on your machine is properly working or not. So I cannot decide whether it is a network problem or a software problem. Best regards, Olivier -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Geo::WebService::Elevation::USGS
I was thinking it might give the fill in form that you get when you go here: https://nationalmap.gov/epqs/ I think you are right. It is acting as intended when visited with a browser. Mike On 8/28/2019 10:00 PM, Olivier wrote: Mike writes: Thanks for the response. Yeah, I don't understand why https://nationalmap.gov/epqs/pqs.php won't open in a browser, but In fact, it does open in a browser and the result is "General failure: Invalid Coordinates". This URL runs the PHP script pqs.php, this script needs input coordinates, if there is no coordinates supplied, this script returns the message about invalid coordinates. This message is not a message from your browser, it is not a message from the web server, it is a message from pqs.php. Your browser and the web server are just fine. And frankly speaking, what result are you expecting? pqs.php is a script that returns some data depending on the input data you give. You give no input, you get no output. https://nationalmap.gov/epqs/ will. I imagine this may have something to do with redirects, but who knows. This URL is missing the filename part (after the last /), in that case, the web server uses a default file (depending on the configuration of the web server) and the default file is presenting a page that asks for coordinates. So you are asking 2 differents URL, that corresponds to two different pages, each page giving the correct result. When I put https://nationalmap.gov/epqs/pqs.php into a web browser it says: General failure: Invalid Coordinates When I put http://ned.usgs.gov/epqs/pqs.php into a web browser it says the same exact thing. And it is expected that the URL with http and with https give the same correct result. When I go to https://nationalmap.gov/epqs/ and put -90.76983 for X and put 38.72360 for Y and hit "Get Elevation" it gives: 3DEP 1/3 arc-second 583.54 Feet When I go to: https://nationalmap.gov/epqs/pqs.php?x=-90.76983&y=38.72360&units=feet&output=xml it gives: 3DEP 1/3 arc-second 583.54 Feet So that works. It works because you are providing correct input. Best regards, Olivier Mike On 8/26/2019 10:26 PM, Uri Guttman wrote: have you tried to just telnet to those hosts? telnet nationalmap.gov:443 telnet: could not resolve nationalmap.gov:443/telnet: Name or service not known telnet ned.usgs.gov:443 telnet: could not resolve ned.usgs.gov:443/telnet: Name or service not known so there is something wrong with the urls and not the code (or the code has bad urls). and just getting the web pages is also failing GET https://ned.usgs.gov/epqs/pqs.php General failure: Invalid Coordinates GET https://nationalmap.gov/epqs/pqs.php General failure: Invalid Coordinates i dunno the module but it seems that you may not be passing in any coordinates or something else is needed. uri -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Geo::WebService::Elevation::USGS
In my Firefox it is set at: "Use system proxy settings" I turned it off briefly, but didn't really see any changes. I do not implement a proxy in LWP::Simple. I don't think I use a system Proxy: http://www.mflan.com/temp/proxy.jpg Mike On 8/29/2019 5:52 AM, Olivier wrote: And another question... Are you using any proxy in your broswer? If you do, how did you implemented that proxy in LWP::Simple? Olivier Olivier writes: Mike writes: Thanks for the response. I agree with everything you say. I just want my LWP::Simple to access every web link that my browser can access. I now know that some of you can run the code below and get all 4 of the websites I have listed to return the website info. All 4 of those web links gives: "Unable to get page at httpfetch.pl line 21." I can see I am not alone in having this problem. Others have had the same problem with only a few web links. I don't see why you have a 'die at line 21' while your script has way less than 21 lines. Also, the script comes all mangled by the mail, so one cannot say if the error is yours or the mailer. Make your script simple first, so you can confirm your environment is working: #!/usr/bin/perl use LWP::Simple; $test=get('https://google.com'); print $test; When that is working, start changing things one at a time and check at each stage that it is still working. You may also explore the documentation of LWP::Simple to get an error message that makes sense, because what you get so far is only 'it does not work', one cannot make a diagnostic with that only. Good luck, Olivier
Re: Geo::WebService::Elevation::USGS
I sure appreciate your help. I have done quite a few things listed on the internet with both Simple and UserAgent. We see that many of the failing sites are govt sites. One guy can access all my Not Working sites, but he says that glorecords and nationalmap.gov react very slow, even when UserAgent uses the FireFox identity. I know I can use Mechanize and really dive into this. And I might do that someday. But for the moment I'm thinking this is unlikely to get fixed in the next week. Good thing I don't need this. Mike On 8/29/2019 5:35 AM, Olivier wrote: I don't see why you have a 'die at line 21' while your script has way less than 21 lines. Also, the script comes all mangled by the mail, so one cannot say if the error is yours or the mailer. Make your script simple first, so you can confirm your environment is working: #!/usr/bin/perl use LWP::Simple; $test=get('https://google.com'); print $test; When that is working, start changing things one at a time and check at each stage that it is still working. You may also explore the documentation of LWP::Simple to get an error message that makes sense, because what you get so far is only 'it does not work', one cannot make a diagnostic with that only. Good luck, Olivier #!/usr/bin/perl use strict; use warnings; use LWP::Simple; # Does not work my $test = get('https://nationalmap.gov/epqs/pqs.php') or die 'Unable to get page'; # Does not work #my $test = get('http://www.wrh.noaa.gov/zoa/mwmap3.php?map=usa') or die 'Unable to get page'; # Does not work #my $test = get('http://www.glorecords.blm.gov/') or die 'Unable to get page'; # Does not work #my $test = get('https://glorecords.blm.gov/default.aspx') or die 'Unable to get page'; # Does not work print "\nAll done.\n\n\$test = $test\n\n"; __END__ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Geo::WebService::Elevation::USGS
Thanks for the response. I agree with everything you say. I just want my LWP::Simple to access every web link that my browser can access. I now know that some of you can run the code below and get all 4 of the websites I have listed to return the website info. All 4 of those web links gives: "Unable to get page at httpfetch.pl line 21." I can see I am not alone in having this problem. Others have had the same problem with only a few web links. #!/usr/bin/perl use strict; use warnings; use LWP::Simple; # Does not work my $test = get('https://nationalmap.gov/epqs/pqs.php') or die 'Unable to get page'; # Does not work #my $test = get('http://www.wrh.noaa.gov/zoa/mwmap3.php?map=usa') or die 'Unable to get page'; # Does not work #my $test = get('http://www.glorecords.blm.gov/') or die 'Unable to get page'; # Does not work #my $test = get('https://glorecords.blm.gov/default.aspx') or die 'Unable to get page'; # Does not work print "\nAll done.\n\n\$test = $test\n\n"; __END__ On 8/28/2019 10:00 PM, Olivier wrote: Mike writes: Thanks for the response. Yeah, I don't understand why https://nationalmap.gov/epqs/pqs.php won't open in a browser, but In fact, it does open in a browser and the result is "General failure: Invalid Coordinates". This URL runs the PHP script pqs.php, this script needs input coordinates, if there is no coordinates supplied, this script returns the message about invalid coordinates. This message is not a message from your browser, it is not a message from the web server, it is a message from pqs.php. Your browser and the web server are just fine. And frankly speaking, what result are you expecting? pqs.php is a script that returns some data depending on the input data you give. You give no input, you get no output. https://nationalmap.gov/epqs/ will. I imagine this may have something to do with redirects, but who knows. This URL is missing the filename part (after the last /), in that case, the web server uses a default file (depending on the configuration of the web server) and the default file is presenting a page that asks for coordinates. So you are asking 2 differents URL, that corresponds to two different pages, each page giving the correct result. When I put https://nationalmap.gov/epqs/pqs.php into a web browser it says: General failure: Invalid Coordinates When I put http://ned.usgs.gov/epqs/pqs.php into a web browser it says the same exact thing. And it is expected that the URL with http and with https give the same correct result. When I go to https://nationalmap.gov/epqs/ and put -90.76983 for X and put 38.72360 for Y and hit "Get Elevation" it gives: 3DEP 1/3 arc-second 583.54 Feet When I go to: https://nationalmap.gov/epqs/pqs.php?x=-90.76983&y=38.72360&units=feet&output=xml it gives: 3DEP 1/3 arc-second 583.54 Feet So that works. It works because you are providing correct input. Best regards, Olivier Mike On 8/26/2019 10:26 PM, Uri Guttman wrote: have you tried to just telnet to those hosts? telnet nationalmap.gov:443 telnet: could not resolve nationalmap.gov:443/telnet: Name or service not known telnet ned.usgs.gov:443 telnet: could not resolve ned.usgs.gov:443/telnet: Name or service not known so there is something wrong with the urls and not the code (or the code has bad urls). and just getting the web pages is also failing GET https://ned.usgs.gov/epqs/pqs.php General failure: Invalid Coordinates GET https://nationalmap.gov/epqs/pqs.php General failure: Invalid Coordinates i dunno the module but it seems that you may not be passing in any coordinates or something else is needed. uri -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Geo::WebService::Elevation::USGS
Thank you. That helps me a lot to know that it works for you. Your code, exactly as you sent it, still does not work for me. It gives: 500 Can't connect to nationalmap.gov:443 (Bad address) at trash.pl line 19. I'm going to try to assign an environment variable to my system. I doubt that will fix it, but I am trying just about everything. I still can't figure out why it works on some URL's, and not others. It's probably going to take me a long time to figure this out. Mike On 8/28/2019 6:26 PM, $Bill wrote: This seems fine on my Win10: use strict; use warnings; use LWP::UserAgent; my $url; if (0) { # set to 1 or 0 to flop urls $url = 'https://nationalmap.gov/epqs'; } else { $url = 'https://nationalmap.gov/epqs/pqs.php?y=34.0&x=-118.0&units=Feet&output=xml'; } my $ua = LWP::UserAgent->new(); # ssl_opts => { verify_hostname => 0, } ); $ua->agent("Mozilla/5.0 (Windows)"); my $response = $ua->get($url); if ($response->is_success) { print $response->content; } else { die $response->status_line; } print "All done.\n\n"; __END__ Dumps the page or elevation depending on url: perl test.pl ?>y="34.0">3DEP 1/3 arc-second916.71FeetAll done. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Geo::WebService::Elevation::USGS
Thanks for the response. Yeah, I don't understand why https://nationalmap.gov/epqs/pqs.php won't open in a browser, but https://nationalmap.gov/epqs/ will. I imagine this may have something to do with redirects, but who knows. When I put https://nationalmap.gov/epqs/pqs.php into a web browser it says: General failure: Invalid Coordinates When I put http://ned.usgs.gov/epqs/pqs.php into a web browser it says the same exact thing. When I go to https://nationalmap.gov/epqs/ and put -90.76983 for X and put 38.72360 for Y and hit "Get Elevation" it gives: 3DEP 1/3 arc-second 583.54 Feet When I go to: https://nationalmap.gov/epqs/pqs.php?x=-90.76983&y=38.72360&units=feet&output=xml it gives: 3DEP 1/3 arc-second 583.54 Feet So that works. Mike On 8/26/2019 10:26 PM, Uri Guttman wrote: have you tried to just telnet to those hosts? telnet nationalmap.gov:443 telnet: could not resolve nationalmap.gov:443/telnet: Name or service not known telnet ned.usgs.gov:443 telnet: could not resolve ned.usgs.gov:443/telnet: Name or service not known so there is something wrong with the urls and not the code (or the code has bad urls). and just getting the web pages is also failing GET https://ned.usgs.gov/epqs/pqs.php General failure: Invalid Coordinates GET https://nationalmap.gov/epqs/pqs.php General failure: Invalid Coordinates i dunno the module but it seems that you may not be passing in any coordinates or something else is needed. uri -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Geo::WebService::Elevation::USGS
Thank you all for the responses. I now think this has nothing to do with Geo::WebService::Elevation::USGS. See the script below for other web links that LWP::Simple cannot reach and parse. I have not figured out why, but the problem is not with USGS.pm,. #!/usr/bin/perl use strict; use warnings; use LWP::Simple; chdir 'C:/Copy'; # Works #my $test = get('http://osgeo-org.1560.x6.nabble.com/') or die 'Unable to get page'; # Works #my $test = get('https://www.chron.com/neighborhood/bayarea/') or die 'Unable to get page'; # Works #my $test = get('http://history.house.gov/Map/Mapping-Congress/') or die 'Unable to get page'; # Works #my $test = get('http://hint.fm/wind/') or die 'Unable to get page'; # Works #my $test = get('http://antwrp.gsfc.nasa.gov/apod/astropix.html') or die 'Unable to get page'; # Works # Does not work my $test = get('https://nationalmap.gov/epqs/') or die 'Unable to get page'; # Does not work #my $test = get('http://www.wrh.noaa.gov/zoa/mwmap3.php?map=usa') or die 'Unable to get page'; # Does not work #my $test = get('http://www.glorecords.blm.gov/') or die 'Unable to get page'; # Does not work #my $test = get('https://glorecords.blm.gov/default.aspx') or die 'Unable to get page'; # Does not work print "\nAll done.\n\n\$test = $test\n\n"; __END__ There is stuff posted about this problem. I have been through using UserAgent, declaring the browser, environment variables, and other things and it still doesn't work. Good thing I don't need this or it would be driving me crazy. I will probably move on to other things now. use strict; use warnings; use LWP::UserAgent; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; my $url = "https://nationalmap.gov/epqs/pqs.php";; my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0, } ); $ua->env_proxy; $ua->agent("Mozilla/5.0 (Windows)"); my $response = $ua->get($url); if ($response->is_success) { print $response->content; } else { die $response->status_line; } print "All done.\n\n"; __END__ Mike On 8/26/2019 10:26 PM, Uri Guttman wrote: On 8/26/19 8:00 PM, Mike wrote: use constant USGS_URL => 'https://ned.usgs.gov/epqs/pqs.php'; to use constant USGS_URL => 'https://nationalmap.gov/epqs/pqs.php'; have you tried to just telnet to those hosts? telnet nationalmap.gov:443 telnet: could not resolve nationalmap.gov:443/telnet: Name or service not known telnet ned.usgs.gov:443 telnet: could not resolve ned.usgs.gov:443/telnet: Name or service not known so there is something wrong with the urls and not the code (or the code has bad urls). and just getting the web pages is also failing GET https://ned.usgs.gov/epqs/pqs.php General failure: Invalid Coordinates GET https://nationalmap.gov/epqs/pqs.php General failure: Invalid Coordinates i dunno the module but it seems that you may not be passing in any coordinates or something else is needed. uri -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Geo::WebService::Elevation::USGS
If there is anybody on Strawberry Perl, would you please go to CPAN and install Geo::WebService::Elevation::USGS Then run this program: #!/usr/bin/perl use strict; use warnings; use Geo::WebService::Elevation::USGS; my $latd = '38.72360'; my $longd = '-90.76983'; my $getelev = Geo::WebService::Elevation::USGS->new(); my $elev = $getelev->elevation($latd, $longd)->{Elevation}; print "All done. Elevation = $elev ft.\n\n"; __END__ I expect you will get this error: 500 Can't connect to ned.usgs.gov:443 (Bad address) at .pl line 12. If instead you get the elevation, please let me know. Then go to USGS.pm, take it off Read Only, and change line 133 from use constant USGS_URL => 'https://ned.usgs.gov/epqs/pqs.php'; to use constant USGS_URL => 'https://nationalmap.gov/epqs/pqs.php'; Then run the program and I expect you will get this error: 500 Can't connect to nationalmap.gov:443 (Bad address) at .pl line 12. If you get either to run correctly, see if you have Geo::WebService in your environment variables. Thank you. Mike -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Problem executing command via ssh
Wow, a complicated question that I know very little about. But since nobody else has jumped in, I will show my ignorance by suggesting this: Perhaps change $command to @command. or use something like local $/; These beginners questions are getting pretty complicated :-) Mike On 8/23/2019 11:16 AM, Mario Galindez wrote: Folks, I need to execute a program in a remote machine, that takes its input from STDIN. I created a user in such remote machine, and set my program as the shell for that account (so I don't need to provide shell access). On my local node, I have this program: #!/usr/bin/perl use IPC::Open3; use POSIX; $inputfile= $ARGV[0]; open(FILE, '<', "$ARGV[0]") or die $!; $command= "ssh user\@remotehost.com <http://remotehost.com>"; $pid = open3('<&FILE', '>&STDOUT', '>&STDERR', $command); waitpid( $pid, 0 ); What I expect is that I pass the name of the file as arguments of this program ($ARGV[0]), and the contents of this file is fed as STDIN of the child I've spawn with open3. This should be received as STDIN of my remote program, and the results of the remote program would be printed on STDOUT. This works well. However, my program only reads the first line, and then terminates. If I do a manual test, and do ssh u...@remotehost.com <mailto:u...@remotehost.com>, and type multiple lines of input, then things work as expected. Any clues? Thanks! -m
Question re remove_tree and symlinks
Am I right in believing that remove_tree from File::Path does not follow symlinks, ie: does not remove the linked file only the link if there are links in the direstories removed eg: #!/usr/bin/perl use strict; use File::Path('make_path','remove_tree'); my $dir='testdellink';# contains links to files in testdel remove_tree($dir,{safe => 1}); Will not remove files in testdel that are linked to in testdellink thanks Mike
Re: Google Sheets API Data Structure
Please state the exact module name. Is it this one: https://metacpan.org/pod/Net::Google::Spreadsheets::V4 My guess is no. Mike On 8/15/2019 10:18 AM, James Kerwin wrote: Hi All, I managed to get the Google Sheets API Perl module working. I'm currently investigating a data structure that it gives me to see what values I can get from it. Through random experimentation I've managed to find that it had "title" and "id". I wrote this to get the data structure containing the worksheets: my @ws = $spreadsheet->worksheets; Now if I do: print $ws[1]->id; print $ws[1]->title; I get the value in the id and the title for the specific item in the array. I want to know what other information is in there. If I do this: for my $href (@ws) { print "{ "; for my $role (keys %{ $href }) { print "$role=$href->{$role} "; } print "}\n"; } I get: { atom=XML::Atom::Entry=HASH(0x1b81928) container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80) } { atom=XML::Atom::Entry=HASH(0x1bbbe98) container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80) } { container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80) atom=XML::Atom::Entry=HASH(0x1b86ca0) } { container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80) atom=XML::Atom::Entry=HASH(0x1b86988) } { container=Net::Google::Spreadsheets::Spreadsheet=HASH(0x1bbdb80) atom=XML::Atom::Entry=HASH(0x1b8c958) } If I use Dumper it just seems to output SO MUCH information that I can't see the wood for the trees. Maybe I'm just tired after a dramatic day in Perl land. Can anyone help me untangle this? My spreadsheet has five worksheets and there are five lines in my output so my assumption is that each line represents a sheet. Any advice/help/guidance would be greatly appreciated. Thanks, James
Open and perl sub
Is it possible to have the output of a perl module piped to open (open3 in my case), so I can use a file handle contains the output passed to sysread Odd question I know Thanks
Re: Install Problems: Net::Google::Spreadsheets
I believe somebody else responded to this, but . . . I'll help if I can. If you want me to try to install Net::Google::Spreadsheets I can. I am on Win7 - Strawberry Perl V 5.26.1 Mike On 8/5/2019 9:47 AM, James Kerwin wrote: Hi All, I'm having some difficulty installing a Perl Module; Net::Google::Spreadsheets". Inititally it was installing in to my user account home directory and I wasn't certain how to change this, so I just added the directory to my @INC (this isn't a live server, it's purely for me to test on at the moment). It appears to do a LOT when installing this module and I won't pretend to be an expert, but I really want it to work as it would be the perfect addition to a script I wrote recently (provides the user with a button to extract data from a database and then ideally pushes the data to a google sheet). Would anybody be kind enough to help me troubleshoot this? Here is some output (apologies if it's not correctly displayed, I can't remember how you all usually request it to be displayed): Net::IDN::Encode is up to date (2.500). HIROSE/Net-Google-Spreadsheets-V4-0.002.tar.gz Has already been unwrapped into directory /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X HIROSE/Net-Google-Spreadsheets-V4-0.002.tar.gz Has already been prepared Running Build for H/HI/HIROSE/Net-Google-Spreadsheets-V4-0.002.tar.gz Warning: Prerequisite 'Net::Google::DataAPI::Auth::OAuth2 => 0' for 'HIROSE/Net-Google-Spreadsheets-V4-0.002.tar.gz' failed when processing 'DANJOU/Net-Google-DataAPI-0.2805.tar.gz' with 'make_test => NO one dependency not OK (XML::Atom); additionally test harness failed'. Continuing, but chances to succeed are limited. cp lib/Net/Google/Spreadsheets/V4.pm blib/lib/Net/Google/Spreadsheets/V4.pm HIROSE/Net-Google-Spreadsheets-V4-0.002.tar.gz ./Build -- OK Running Build test t/00_compile.t .. 1/? # Failed test 'use Net::Google::Spreadsheets::V4;' # at t/00_compile.t line 4. # Tried to use 'Net::Google::Spreadsheets::V4'. # Error: Can't locate Net/Google/DataAPI/Auth/OAuth2.pm in @INC (you may need to install the Net::Google::DataAPI::Auth::OAuth2 module) (@INC contains: /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X/blib/arch /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X/blib/lib /home/james/.cpan /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X/blib/lib/Net/Google/Spreadsheets/V4.pm line 18. # BEGIN failed--compilation aborted at /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X/blib/lib/Net/Google/Spreadsheets/V4.pm line 18. # Compilation failed in require at t/00_compile.t line 4. # BEGIN failed--compilation aborted at t/00_compile.t line 4. # Looks like you failed 1 test of 1. t/00_compile.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests t/01_new.t .. Can't locate Net/Google/DataAPI/Auth/OAuth2.pm in @INC (you may need to install the Net::Google::DataAPI::Auth::OAuth2 module) (@INC contains: /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X/blib/arch /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X/blib/lib /home/james/.cpan /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X/blib/lib/Net/Google/Spreadsheets/V4.pm line 18. BEGIN failed--compilation aborted at /home/james/.cpan/build/Net-Google-Spreadsheets-V4-0.002-gyJS1X/blib/lib/Net/Google/Spreadsheets/V4.pm line 18. Compilation failed in require at t/01_new.t line 4. t/01_new.t .. Dubious, test returned 2 (wstat 512, 0x200) No subtests run t/author-00_basic.t . skipped: these tests are for testing by the author t/author-critic.t ... skipped: these tests are for testing by the author t/author-dependencies.t . skipped: these tests are for testing by the author t/author-pod-spell.t skipped: these tests are for testing by the author t/release-fixme.t ... skipped: these tests are for release candidate testing t/release-kwalitee-extra.t .. skipped: these tests are for release candidate testing t/release-kwalitee.t skipped: these tests are for release candidate testing t/release-pod-syntax.t .. skipped: these tests are for release candidate testing t/release-unused-vars
Re: Device::SerialPort on debian Buster
I didn't see a lot of responses to this, so I guess you really answered your own question. Must be something wrong with the Buster OS. See if these do you any good: https://forum.arduino.cc/index.php?topic=109475.0 https://www.linuxquestions.org/questions/ubuntu-63/serial-port-problem-516635/ Mike On 7/10/2019 8:51 AM, Martin McCormick wrote: Before I take this too far, I want to make sure I am not doing something wrong with use of the Device::SerialPort module in perl. The code below talks to what it thinks is a RS-232 serial port and controlls a radio scanner so that one can program the scanner's settings and enter frequency and operational data. Don't worry about all that. It used to work on debian stretch which is last year's version of debian. After an upgrade to buster which is this year's version, also known as debian 10, all RS-232 ports appear to be dead. Interestingly enough, a debian system running stretch, containing perl was upgraded to buster and serial communications between that system and a native serial port on it's mother board are fine. The very same code ported to the buster system also fails with Can't call method "baudrate" on an undefined value at /home/martin/etc/mm line 121. It doesn't matter what serial port or whether it is native mother board hardware or what. Serial ports are all broken right now. Here is the scanner control code. I am sending it to see if I am using some deprecated method that is wrong to set the serial port or we really do have big trouble. Thanks for any and all constructive ideas. Code follows: #!/usr/bin/perl -w use strict; use warnings::unused; use File::Basename; use File::Copy; use File::Spec; use Time::Local; use Device::SerialPort; sub waitfor {#Receive from serial port. my $received = ""; our $port; until ( "" ne $received ) { $received = $port->lookfor; } return ($received); }#Receive from serial port. #no more sub routine code past this point #main global variables our @dbstrings; #main local variables my $response; my $cmd= ""; my $ONEARG = ""; #my $counter = 1; #Setup the comm port. my $dev = "/dev/ttyACM0"; our $instring = ""; our $port = Device::SerialPort->new("$dev"); $port->baudrate(115200); $port->databits(8); $port->parity("none"); $port->stopbits(1); $port->handshake("none"); $port->read_const_time(500);# 500 milliseconds = 0.5 seconds $port->are_match( "\r", "\n", );# possible end strings foreach $ONEARG (@ARGV) { #each argument $ONEARG =~ s/^\s+//; $ONEARG =~ s/\s+$//; $cmd = $cmd . " " . $ONEARG; $cmd =~ s/^\s+//; $cmd =~ s/\s+$//; }#each argument $cmd = uc $cmd; $port->write("$cmd\r"); $instring = waitfor; my @chars = split( "", $instring ); foreach my $char (@chars) {# #print ord($char); if ( $char =~ /[\,\s\.\-\+\_0-9A-Za-z]/ ) {#printable $response = $response . $char; }#printable }# print "$response\n"; $instring = ""; exit(0); -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: What are these numbers (gmtime, slice)
Uri Guttman writes: > On 7/4/19 2:41 PM, Mike Small wrote: >> A co-worker was trying to take some of the elements from gmtime's return >> value. He did something like the following: >> >> $ perl -E'$,="\t";say gmtime[1..5]' > > that is calling gmtime with the argument of [1..5] which is an > arrayref. so the arg to gmtime is some large address number. it is > then parsed as the timestamp and broken out. garbage in, garbage out! Thanks Uri! That makes perfect sense now that I see it explained. -- Mike Small sma...@sdf.org -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
What are these numbers (gmtime, slice)
A co-worker was trying to take some of the elements from gmtime's return value. He did something like the following: $ perl -E'$,="\t";say gmtime[1..5]' 8 32 12 31 7 2999416 1 243 0 I suggested he try something like this instead... $ perl -E'$,="\t";say ((gmtime)[1..5])' 36 18 4 6 119 ... and that was what he wanted, but it didn't matter because he re-rewrote his code to use strftime, which we both thought was more readable. But still, what are those numbers in the first example? Neither of us can figure where they come from. The parens must be a clue, but all I could think was gmtime was interpreted as an array reference, but thinking that didn't get me anywhere that made sense to me. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
trouble
I am having trouble posting to the Beginners Perl list. Is there a problem? I understand that to upload a module to CPAN is need to obtain a PAUSE account. I have tried twice to get that, but I don't receive an e-mail with a password. http://www.mflan.com/temp/pause.jpg If anybody can notify the PAUSE people that the PAUSE program appears to be broke, please do. Mike -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: PAUSE
I never did receive the e-mails to my AT&T e-mail, but a person in Demmark, or someplace like that, gave me some personal attention and I believe all is good now. Thanks so much to Shlomi, Andreas and everybody else. I first applied to PAUSE on 6/9/2019. Mike On 6/30/2019 7:07 PM, pengyong...@virgilio.it wrote: He will be waiting for more days to get a response from PAUSE. I once tried to apply for that, after a few days I got the verification mail. On June 30, 2019 at 2:23 PM Shlomi Fish wrote: Hi all, can someone try to help Mike here? On Sun, 30 Jun 2019 05:10:19 -0500 Mike wrote: I understand that to upload a module to CPAN is need to obtain a PAUSE account. I have tried twice to get that, but I don't receive an e-mail with a password. http://www.mflan.com/temp/pause.jpg If anybody can notify the PAUSE people that the PAUSE program appears to be broke, please do. Mike -- - Shlomi Fish http://www.shlomifish.org/ Understand what Open Source is - http://shlom.in/oss-fs “Did you sleep well?” “No, I made a couple of mistakes.” — https://en.wikiquote.org/wiki/Steven_Wright via Nadav Har’El Please reply to list if it's a mailing list post - http://shlom.in/reply . -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
PAUSE
I understand that to upload a module to CPAN is need to obtain a PAUSE account. I have tried twice to get that, but I don't receive an e-mail with a password. http://www.mflan.com/temp/pause.jpg If anybody can notify the PAUSE people that the PAUSE program appears to be broke, please do. Mike -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: CPAN not working, or is it?
I wanted you to know that we are out here, but just unable to help you. I doubt this old post will help you any: https://centosfaq.org/centos/perl-on-centos-6-and-centos-7/ Mike On 3/11/2019 8:55 AM, Gary Stainburn wrote: I'm replacing a dead F19 box with a new C7 one and I'm trying to get my Perl install completed. Ultimately, I need to get Selenium::Remote::Driver working, but I'm struggling before that. I started off as always by using RPM's for everything I possibly can. I then started to use CPAN for everything else. It looked like CPAN was working and things were installing "OK". However, as I went for bigger modules, anything that had dependences were then failing as the dependencie were installed OK but then did not appear to be available. The last thing I've just tried is to update CPAN as the RPM is 1.9800 and the latest is 2.6. As you can see below, the install worked, but when it reloaded, or when I came out and went back in, it still showed 1.9800 Anyone got any ideas what I need to do? cpan[2]> install CPAN Running install for module 'CPAN' Running make for A/AN/ANDK/CPAN-2.25.tar.gz Fetching with LWP: http://mirror.bytemark.co.uk/CPAN/authors/id/A/AN/ANDK/CPAN-2.25.tar.gz Fetching with LWP: http://mirror.bytemark.co.uk/CPAN/authors/id/A/AN/ANDK/CHECKSUMS Checksum for /root/.cpan/sources/authors/id/A/AN/ANDK/CPAN-2.25.tar.gz ok CPAN.pm: Building A/AN/ANDK/CPAN-2.25.tar.gz Importing PAUSE public key into your GnuPG keychain... done! (You may wish to trust it locally with 'gpg --lsign-key 450F89EC') Checking if your kit is complete... Looks good Writing Makefile for CPAN Writing MYMETA.yml and MYMETA.json snip -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: covert perl code to binary
Thanks. My Strawberry install finally failed with Stopping: 'install' failed for 'B::C'. I am running ver 5.26 of Strawberry. I suspect you mean this Readme file: |INSTALL| |cpan B::C| |On strawberry I needed| |||perl Makefile.PL FIXIN="perl -S pl2bat.bat"| |On Windows and AIX for 5.12 and 5.14 you need to patch and rebuild CORE perl:| |||ramblings/Export-store_cop_label-for-the-perl-compiler.patch| |For 5.14 and 5.15 I recommend also the following patches:| |||ramblings/revert-B-load-BEGIN.patch (The 5.14.1 version)| |||ramblings/Carp-wo-B.patch| |We generally discourage the use of perl since 5.16 unhandled and| |unacknowledged security problems with the implementation of "unicode"| |symbols and packagenames, where they really implemented binary names| |for all symbols without any checks and further support of such binary| |names. Identifiers are not identifiable anymore.| |See the warning at perl Makefile.PL.| |5.20 improved support for binary names for most syscalls, dumpers and| |APIs, but TR39 and strict names are still not handled, the problems| |are not understood and reactions are generally hostile.| |5.18 made it 20% bigger with the implementation of COW strings.| |Most strings cannot be stored statically anymore since then.| |The best perl versions for the compiler are 5.14.4, 5.22.1 and cperl,| |since these are the most tested versions, where the coretest suite passes. The above is only part of the Readme file. I'm not sure what to make of that. Especially that part that says: 'We generally discourage the use of perl since 5.16 unhandled and unacknowledged security problems' Mike | On 1/11/2019 9:28 AM, Bruce Ferrell wrote: I built it on a Linux box, it blew up so I read the README... that has instructions for how to do it on Windows As noted by another poster, it seems to work in spite of the test blowing up On 1/11/19 5:37 AM, Mike Flannigan wrote: I could use some more explanation. B::C is a module that you install from CPAN. I assume I don't put Use B::C at the top of my perl script, but instead perlcc uses it. Is perlcc also a module? Or is that an executable? I think I see that it is composed of 5 files: assemble cc_harness disassemble perlcc.PL pl2exe.pl After installing perlcc, do I just open a command prompt and type perlcc -o hello.exe hello.pl? Does all this work on Windows? My guess is Yes. Mike On 1/11/2019 6:57 AM, Andrew Solomon wrote: Just a warning - I'm no expert on this topic, but it was such an interesting question I decided to find out for myself :-) I installed B::C and ran https://metacpan.org/pod/distribution/B-C/script/perlcc.PL It actually does the compilation - as opposed to pp which is just packaging it - so you don't see the perl code of the source file. Does that resolve your question? Andrew On Fri, Jan 11, 2019 at 9:59 AM Uday Vernekar mailto:vernekaru...@gmail.com>> wrote: Hi all, I have a perl code which I need to covert to binary so that nobody can see the code. we used pp package to make the perl code binary but here the user can see the code which gets created in tmp. Need help if anybody knows kindly reply With regards Uday V G -- Andrew Solomon Perl Trainer, Geekuni http://geekuni.com/ and...@geekuni.com <mailto:and...@geekuni.com> // +44 7931 946 062
Re: covert perl code to binary
Thanks. On Windows I did 'cpan install B::C' and it went on and on with many test fails. After about 3 minutes it threw a 'Perl interpreter has stopped working' error (details below) and when I closed that box it continued with the test fails for another 3+ minutes and then stopped (it was probably still running - I did a Ctrl C on it). One little item I picked out is ExtUtils::Install generates non-zero binary' So then I did 'cpan install -n B::C' and that also ran about 5 minutes with test fails and threw a 'Perl interpreter has stopped working' error. When I closed that box it continued with the test fails for another 5+ minutes (I took a shower in here) and then slowed down on statements like # Failed test '6: use Pod::Perldoc -O3 gives expected 'ok' outpu # at t/modules.t line 227. # '' # doesn't match '(?^ms:ok$)' The install still running, but I think it is safe to say it does not install real good on Strawberry Perl. Mike Problem Event Name: APPCRASH Application Name: perl.exe Application Version: 5.26.1.1 Application Timestamp: 59c72b89 Fault Module Name: ntdll.dll Fault Module Version: 6.1.7601.24335 Fault Module Timestamp: 5c268115 Exception Code: c005 Exception Offset: 0002a407 OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 1033 Additional Information 1: 62e2 Additional Information 2: 62e210e3d23b68abf45108a88f3afb70 Additional Information 3: 2f51 Additional Information 4: 2f51a0ca5e5e9ac099301d839e2f4ce3 On 1/11/2019 8:53 AM, Andrew Solomon wrote: Sorry Mike, I was a bit too terse! Here's what I did on a mac OS X 10.13.6 containing perl-5.26.1 installed with perlbrew. cpanm -n B::C where -n means 'no test' because the first time I tried it the testing failed and I wasn't curious enough to work out what went wrong :-) Then I had a file foo.pl <http://foo.pl> which was executable and contained: #!/usr/bin/env perl use 5.26.1; say "Hello, world."; say "Hello, world."; say "Hello, world."; say "Hello, world."; say "Hello, world."; say "Hello, world."; say "Hello, world."; say "Hello, world."; I then ran perlcc foo.pl <http://foo.pl> and found a file "foo". I ran ./foo and its output was the same as ./foo.pl <http://foo.pl> Opening foo, I found the string 'Hello, world.' but only once amongst a lot of control characters and error messages. I'm afraid I don't have a Windows box to experiment with. Andrew On Fri, Jan 11, 2019 at 1:37 PM Mike Flannigan <mailto:mikef...@att.net>> wrote: I could use some more explanation. B::C is a module that you install from CPAN. I assume I don't put Use B::C at the top of my perl script, but instead perlcc uses it. Is perlcc also a module? Or is that an executable? I think I see that it is composed of 5 files: assemble cc_harness disassemble perlcc.PL pl2exe.pl <http://pl2exe.pl> After installing perlcc, do I just open a command prompt and type perlcc -o hello.exe hello.pl <http://hello.pl>? Does all this work on Windows? My guess is Yes. Mike
Re: covert perl code to binary
I could use some more explanation. B::C is a module that you install from CPAN. I assume I don't put Use B::C at the top of my perl script, but instead perlcc uses it. Is perlcc also a module? Or is that an executable? I think I see that it is composed of 5 files: assemble cc_harness disassemble perlcc.PL pl2exe.pl After installing perlcc, do I just open a command prompt and type perlcc -o hello.exe hello.pl? Does all this work on Windows? My guess is Yes. Mike On 1/11/2019 6:57 AM, Andrew Solomon wrote: Just a warning - I'm no expert on this topic, but it was such an interesting question I decided to find out for myself :-) I installed B::C and ran https://metacpan.org/pod/distribution/B-C/script/perlcc.PL It actually does the compilation - as opposed to pp which is just packaging it - so you don't see the perl code of the source file. Does that resolve your question? Andrew On Fri, Jan 11, 2019 at 9:59 AM Uday Vernekar <mailto:vernekaru...@gmail.com>> wrote: Hi all, I have a perl code which I need to covert to binary so that nobody can see the code. we used pp package to make the perl code binary but here the user can see the code which gets created in tmp. Need help if anybody knows kindly reply With regards Uday V G -- Andrew Solomon Perl Trainer, Geekuni http://geekuni.com/ and...@geekuni.com <mailto:and...@geekuni.com> // +44 7931 946 062
How to test for existence of file with non-ascii characters
Any ideas how to test for the existance of a file, when the file name contains extended ascii characters For example if the file contains emdash (U-2014) file -e always returns false thanks Mike
Re: What does "use 5.008;" affect?
I'm still not sure I know, but I learned a lot from these articles: https://stackoverflow.com/questions/1878108/whats-the-modern-way-of-declaring-which-version-of-perl-to-use https://perldoc.perl.org/functions/use.html Maybe the 2nd one describes what it does. Mike On 12/22/2018 3:43 AM, beginners-digest-h...@perl.org wrote: Subject: What does "use 5.008;" affect? From: Leam Hall Date: 12/22/2018, 3:43 AM To: beginners@perl.org I've seen code that has "use 5.008_004;" in the files. Yet the code also uses tools like Build.PL that came after Perl 5.008. What does the "use $perl_version" actually affect? Thanks!
Re: Code Assistance Pls
These 2 lines: if (/^ file-id $i/) { and elsif (/^ exit/) { Need to be like this: if (/^\s+file-id $/i) { # 2 CHANGES HERE - PAY CLOSE ATTENTION and elsif (/^\s+exit/i) { I am not sure this will fix all your problems. Mike On 11/21/2018 5:08 AM, Amanda Paziuk wrote: Folks, I'm hoping someone can assist as I'm having difficulty with parsing a section of the following configuration: This is the code I have: open (IN, $file); # only sharing this because you need to know where @list is derived. while () { chomp; next unless /file-id/; my $datum = $_; $datum =~ s/(^\s+|\s+$)//g; $datum =~ s/file-id //g; push @list, $datum; # should only contain '1', and '3' } close IN; # ideally this would take a snippet of that config $count = 0; foreach my $i (@list){ # loops through dynamically-learned file IDs open (IN, $file); while () { chomp; if (/^ file-id $i/) { $count = 1; } elsif (/^ exit/) { # this just keeps matching every exit with that same indent $count = 0; } elsif ($count) { if (/text/) { push @logfiles, $_; # successfully captures only what I want in the array } } } close IN; } The first is to find all file-id lines then isolate for the number; the second loop is to take a snip: file-id 1 text exit What it winds up doing is: file-id 1 text exit file-id 3 text exit / exit/ / exit/ / exit/ / exit/ / exit / ... This is the nightmare config structure that I need to deal with throughout the file..lots of "exits" so it matches an awful lot... log file-id 1 text exit file-id 3 text exit exit The configuration is thousands of lines long, indented like that with exit at various levels, so this is just one part of what I'm trying to analyze. What it's doing is making the server work harder with all the extra stuff it's catching and leaves me wide-open for false positives... My question: does anyone have a better way to take those snippets, stopping after the first match of "exit"? (Please don't flame, I'm asking for help.) Amanda
Re: Strange behavior when printing a 4G+ integer on 32bits platform.
I don't have an answer for you, but I find this interesting. I note the same issue in 64bit up near 18446744073709551615 I'm guessing the guy who wrote Math::BigInt may have the answer. Mike On 11/13/2018 8:07 AM, Tetsuo Handa wrote: Hello. I want to represent up to a few hundreds gigabytes for file size. On 32bits platform, I noticed that my $value = ...; printf("%u\n", $value); prints 4294967295 if $value >= 4294967295 whereas my $value = ...; printf("%s\n", $value); and use Math::BigInt; my $value = ...; printf("%s\n", Math::BigInt->new($value)->bstr()); print correct value even when $value >= 4294967295. Is it guaranteed (e.g. described as language specification) that printf("%s\n", $value) will print correct value for any environment? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: data structure for Template Toolkit
Are you on Linux or using Strawberry Perl? I used Activestate for 15+ years and I was surprised by how easy it was to move to Strawberry Perl about 3 years ago. It's pretty darn easy to install modules with Strawberry Perl and seems to work every time. Mike Uri, thanks for the boatload of useful suggestions! I will am busying myself with understanding and applying them. Regarding Template::Simple, this module isn’t among the many that my host has installed, and I have not had success trying to learn how to install stuff from CPAN. Fortunately I’m beginning to get the hang of Template Toolkit, and I may need it for more complex situations that come up. Switching from HTML::template this year was a challenge, and I had to rewrite a lot of my perl to go with it. I know that most perl people are good at using the CPAN resource, but I’m just a high school teacher who dabbles in perl. And at age 74 I have to be choosy about which learning curves I take on! Still, if anyone can point me to a “beginners guide” to using CPAN, I’ll take a look at it. Rick Triplett
Re: data structure for Template Toolkit
I hope somebody has replied already. If not, in general you are reading data from DATA, creating an array and a hash, and then creating an html file using the Template Toolkit. I think much of it looks good, but I see no use Template::Toolkit or anything similar. Do you have that? I suspect you do. Maybe you should post that part too. Also, this line looks suspicious to me: my %list = (list => \@courses); Maybe that is intended to be an array ref. Perhaps right after that you should put this: print "\%list contains this:\n\n"; foreach my $key (sort keys %list){ print "$key - $list{$key}\n"; } __END__ This is a way for you to debug it yourself. If that works as expected, then get back to us. Mike On 10/28/2018 3:45 PM, Rick T wrote: As a novice in perl I realize that it’s a bit presumptuous for me to attempt references and complex data structures. But I had a need and gave it a shot — a failing shot. I’ve been fiddling with my failure, almost mindlessly, all weekend; now I need some help. Below is the template segment I am trying to populate with data, and following it is the segment of code that attempts to call it. The output I get in my browser is persistently empty, with every instance of [% %] being replaced with banks. start HTML [% FOREACH course IN courses %] [% courses.category %] [% course.caption %] L4 (HN) value="[% course.title %]_q1l4v[% courses.version %]"> 1-4 value="[% course.title %]_q2l4v[% course.version %]"> 2-4 value="[% course.title %]_q3l4v[% course.version %]"> 3-4 value="[% course.title %]_q4l4v[% course.version %]"> 4-4 [% END %]
Re: sftp code to use
One way to unzip with Perl is this method: use warnings; use strict; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); my $zipfile = 'zipped.zip'; my $zip = Archive::Zip->new(); die "Error reading $zipfile:$!" unless $zip->read($zipfile) == AZ_OK; $zip->extractMember($zipfile) for $zip->members; __END__ On Oct 21, 2018, at 10:56 AM, Asad wrote: Hi All , I need to accomplish the following task . i was trying in python using subprocess and adive how to proceed will be helpful sftp u...@xyx.com 1212 pasword:xxx cd /patch1 get patch1.zip unzip patch1.zip sqlplus / as sysdba ===> connect to oracle database sql>startup Thanks, -- Asad Hasan +91 9582111698 Jim Gibson
Re: sftp code to use
One way to unzip with Perl is this method: use warnings; use strict; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); my $zipfile = 'zipped.zip'; my $zip = Archive::Zip->new(); die "Error reading $zipfile:$!" unless $zip->read($zipfile) == AZ_OK; $zip->extractMember($zipfile) for $zip->members; __END__ On Oct 21, 2018, at 10:56 AM, Asad wrote: Hi All , I need to accomplish the following task . i was trying in python using subprocess and adive how to proceed will be helpful sftp u...@xyx.com 1212 pasword:xxx cd /patch1 get patch1.zip unzip patch1.zip sqlplus / as sysdba ===> connect to oracle database sql>startup Thanks, -- Asad Hasan +91 9582111698 Jim Gibson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Regex for date
Really, no attempt to do it yourself? Mike On 8/25/2018 6:06 AM, beginners-digest-h...@perl.org wrote: Hi All , I need a regex to match the date : Sat Aug 25 08:41:03 2018 and covert into a format : '%m/%d/%Y %H:%M:%S' Thanks, -- Asad Hasan
Re: What hash function to use
I hope somebody helps you with this. I don't think this will help you. It sounds like you already know all of this: https://crackstation.net/hashing-security.htm I don't know what $2b$ is. Still trying to figure that out. It looks like Digest::Bcrypt was last updated 3/2017. I hope it hasn't been abandoned. Mike On 8/23/2018 3:00 AM, beginners-digest-h...@perl.org wrote: Hello, I am not sure if my question is really of beginer level. On a system, I have set my password to "t410" and it has ben hashed to: $2b$10$OQBll77HJqnOR.zqK2jx8ukE6m68Azc7nrsgRdcT6bVfERRmzFV4. What could I use with Perl to get the same result? I tried Digest::Bcrypt but it does not support $2b$ as far as I can tell. Thanks in advance, Olivier
Re: Regex for date format
Worked perfectly thanks, uri, and same technique works perfectly in postgresql regexp_replace for info On 29 June 2018 at 16:18, Mike Martin wrote: > Thanks > > > On Fri, 29 Jun 2018, 15:48 Uri Guttman, wrote: > >> On 06/29/2018 10:41 AM, Mike Martin wrote: >> >> sorry >> -mm-dd hh:mm:ss.dd >> eg: >> 2018-01-01 12-45-10-456789 to >> 2018-01-01 12:45:10.456789 >> >> >> >> please reply to the list and not to me! >> >> then why did you want lookbehind? this is very easy if you just grab the >> time parts and reassemble them as you want. >> >> $stamp =~ s/\s(\d\d)-(\d\d)-(\d\d)-/ $1:$2:$3./ ; >> >> it uses the space to mark where the time part starts. >> >> uri >> >> >>
Re: Regex for date format
Thanks On Fri, 29 Jun 2018, 15:48 Uri Guttman, wrote: > On 06/29/2018 10:41 AM, Mike Martin wrote: > > sorry > -mm-dd hh:mm:ss.dd > eg: > 2018-01-01 12-45-10-456789 to > 2018-01-01 12:45:10.456789 > > > > please reply to the list and not to me! > > then why did you want lookbehind? this is very easy if you just grab the > time parts and reassemble them as you want. > > $stamp =~ s/\s(\d\d)-(\d\d)-(\d\d)-/ $1:$2:$3./ ; > > it uses the space to mark where the time part starts. > > uri > > >
Regex for date format
Hi I am trying to convert a string of the format 2018-01-01 16-45-21-654278 to a proper timestamp string so basically I want to replace all - after the date part I am getting a bit stuck, lookbehind doesnt seem to work as it includes the lookbehind on every occurence last attempt is s/(?<= )-/:/g; any help appreciated Mike
Re: difficulty with matching
Please make an executable code without the hash (just use a variable) and with the DATA fed below __DATA__ in the script. Then I would suggest putting an "if" in front of the match line and print "It Matched.\n". Maybe put a elsif with only 2 matches. If you keep playing with it like this you can at least figure out what it is doing, but maybe not why. The manpages will probably be needed to answer that. Please let us know what you find out. Mike On 6/1/2018 3:55 PM, beginners-digest-h...@perl.org wrote: Subject: difficulty with matching From: Rick T Date: 6/1/2018 3:54 PM To: Perl Beginners This is a newbie question, I’m sure. But I get perplexed easily! The follow code segment expects to receive a $student_id consisting of a surname followed by a hyphen followed by a number. The die is for testing what I’m doing. If I feed it 'jones-123’ it dies with ‘jones, - , 123’ as I expected. But if I feed it ‘jones-‘ omitting the number on the end, it dies with no matches at all (or blanks): ‘ , , ‘ and I cannot figure out why it does not die with ‘jones, -, ' and would appreciate an explanation. Many thanks! $student_id = lc $student_info_hash{student_id}; # Impose lower case $student_id =~ s/\s//xmsg; # Remove whitespace $student_id =~ m{ \A([a-z]+) # match and capture leading alphabetics (-) # hyphen to separate surname from student number ([0-9]+\z) # match and capture trailing digits }xms; # Perl Best Practices $student_surname = $1; my $hyphen = $2; $student_number = $3; die "$student_surname, $hyphen, $student_number”; Rick Triplett
Unzipping pkzip archives
Hi Does anyone know if there is a perl solution to uncompressing zip archives created with pkzip? I have tried Archive::Uncompress and IO::Archive and both fail with compression type 9 errors, apparently due to proprietary format thanks Mike
Re: regex with HEX ascii chars
Try: binmode(HANDLE) before reading the file. HANDLE is your filehandle. If that doesn't work you might want to supply the text file and a sample script. Mike On 4/12/2018 12:04 PM, beginners-digest-h...@perl.org wrote: I have a text file (created by pdftotext) that I've imported into my script. It contains ASCII characters 251 for crosses and 252 for ticks. If I load the file in gvim and do :as it reports the characters as 251, Hex 00fb, Octal 373 252, hex 00fc, Octal 374 However, when I try to seacch for it using if ($line=~/[\xfb|\xfc]/) { or even just if ($line=~/\xfb/) { it always fails. What am I doing wrong? Gary
Re: [^/]* Is Not Working
Correction, I am now receiving the posts. Sorry. On 3/23/2018 8:12 PM, beginners-digest-h...@perl.org wrote: Thank you John Anderson and others. I see your answers in the archives, but for some reason I am not receiving the list postings anymore. I am working to correct that. It appears the last time I received a post was 3/17/2018. Mike
Re: [^/]* Is Not Working
Thank you John Anderson and others. I see your answers in the archives, but for some reason I am not receiving the list postings anymore. I am working to correct that. It appears the last time I received a post was 3/17/2018. Mike On 3/17/2018 10:02 AM, Mike Flannigan wrote: This line works fine: if ($link =~ m#/([^/]*)$#) { But this one in its place does not work: if ($link =~ m/\/([^/]*)$/) { # Oddly this does not work Gives error: Unmatched [ in regex; marked by <-- HERE in m//([ <-- HERE ^/ at csvtopo24.pl line 74. I think it has to do with the "[^/]*". Anybody have an explanation for this? Mike Simplified code: #!/usr/bin/perl use strict; use warnings; my $link = '/tree'; #if ($link =~ m/\/([^/]*)$/) { # Oddly this does not work if ($link =~ m#/([^/]*)$#) { my $match = $1; print "\nIt worked - $match.\n\n"; } __END__ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
[^/]* Is Not Working
This line works fine: if ($link =~ m#/([^/]*)$#) { But this one in its place does not work: if ($link =~ m/\/([^/]*)$/) { # Oddly this does not work Gives error: Unmatched [ in regex; marked by <-- HERE in m//([ <-- HERE ^/ at csvtopo24.pl line 74. I think it has to do with the "[^/]*". Anybody have an explanation for this? Mike Simplified code: #!/usr/bin/perl use strict; use warnings; my $link = '/tree'; #if ($link =~ m/\/([^/]*)$/) { # Oddly this does not work if ($link =~ m#/([^/]*)$#) { my $match = $1; print "\nIt worked - $match.\n\n"; } __END__ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Checking if a website is up doesn't work correctly
See if some version of the attached program gives the results you expect. Mike On 2/13/2018 8:33 PM, beginners-digest-h...@perl.org wrote: I tried WWW::Mechanize, and (of course) got also 403. Really strange. Is there another tool I could use for checking? I mean some tool in the Perl universe? -- Manfred # # # This scipt checks links in the html in the __DATA__ section # and reports if they are good links or bad links. # # #!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTML::LinkExtor; #-- #-- i am being very lazy in the demo #-- you should really localize it in a block #-- local $/; my $p = HTML::LinkExtor->new(\&hrefs)->parse(); sub hrefs{ my($tag,@links) = @_; return unless($tag =~ /^a$/i); my $p = LWP::UserAgent->new->request( HTTP::Request->new(GET => $links[1])); print $p->is_success ? "GOOD: $links[1]" : $p->status_line . " $links[1]", "\n"; } __DATA__ http://scripts.sil.org/robots.txt";> https://shlomif.github.io/";> https://notabug.org";> http://scripts.sil.org/OFL";> __END__ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Find::Perl find not returning
Hi I have the following code use strict; use File::Find; my @vsbe; my $top='P:\PT-6\PT-60\PT-603\Shared\Data Store\Files Dump Folder'; my $max_depth=9; my $cnt1=0; find({wanted=>\&wanted1,preprocess=>\&preprocess1},$top) ; sub wanted1 { if ($cnt1 <=1000){ my $file = $File::Find::name; if (grep {/vsb$/} $file){ push @vsbe, $file if $cnt1 <=1000 ; $cnt1++; print $cnt1,"\n" ; } else {return} return if $cnt1 >=1000 } return } sub preprocess1 { my $depth = $File::Find::dir =~ tr[\\][]; #print 'depth',"\t",$depth,"\t",$File::Find::dir,"\n"; return @_ if $depth < $max_depth; return grep { not -d } @_ if $depth == $max_depth; return; } Unfortunately the wanted function never returns, it (at best) stays stuck on print the last value of $cnt1 (1000) Any ideas what is happening here
Re: Unescaped Left Brace
Thanks so much for pointing that out. After 15 years of Perl I am still learning, though much slower than before. I still use Perl every day - most for mapping of cemeteries, caves, springs, etc. But also for basic text manipulation and may other things. It sure has served me well over these years. I looked at Python once and could not justify even starting with it. Mike On 11/24/2017 11:29 AM, Andy Bach wrote: unless ($text =~ /[a-zA-Z\s]{10,}/s) { If you're here checking if $text has at least 10 letters/spaces, you don't need the range unless ($text =~ /[a-zA-Z\s]{10}/s) { does the same thing. There may well be more than 10 (one would hope so ;-) but the 2nd will match anyone the first will match and be "cheaper", for the RE engine, I'd bet. Now if you were going to do something w/ those 10+ chars, then the range unless ($text =~ /([a-zA-Z\s]{10,})/s) { would be correct - possibly getting all of the first 10+ char sentence/phrase up to the first punctuation mark. On Thu, Nov 23, 2017 at 6:56 PM, Mike Flannigan <mailto:mikef...@att.net>> wrote: Thanks for pointing that out. I'll be darned. I need to check some of my scripts for this error. I'm not sure what I was trying to do with that. Probably eliminate very small files. $text is a read from a PDF file: This is what I wrote a long time ago: eval { ($text = $pdf->getPageText($page)); }; if ($@) { print "$date | Skipping $filename since it won't parse\n\n"; print OUT "$date | Skipping $filename since it won't parse\n\n" unless exists $log{$filename}; goto SKIP; } $text = "" unless defined $text; unless ($text =~ /[a-zA-Z]{,10}/s) { undef @lines; undef $texttemp; goto SKIP; } Because of this error I think all PDF files are eliminated from consideration, which is not a huge problem, but is not intended. Without doing a whole lot of thinking, I think I may change that one line to: unless ($text =~ /[a-zA-Z\s]{10,}/s) { Thanks for the response. Mike On 11/23/2017 8:31 AM, X Dungeness wrote: Hm, that's a misbegotten quantifier. From 5.26.0 perlreref: There is no quantifier "{,n}". That's interpreted as a literal string. On Thu, Nov 23, 2017 at 3:04 AM, Mike Flannigan mailto:mikef...@att.net>> wrote: I recently installed the latest version of Strawberry Perl. My scripts were developed in ActiveState Perl. I have a line: unless ($text =~ /[a-zA-Z]{,10}/s) { When I run the script that line is in I get: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/[a-zA-Z]{ <-- HERE ,10}/ at htmlpost.pl <http://htmlpost.pl> line 316. I see this: http://www.perlmonks.org/?node_id=1104517 <http://www.perlmonks.org/?node_id=1104517> I also see that escaping it with my ActiveState Perl messes up it's function entirely, but still allows it to run with no errors so I say this is a huge problem. Seems like the migration to Perl 5.30 is going to be interesting to say the least. Anybody have any other comments about this? Mike Flannigan -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org <mailto:beginners-unsubscr...@perl.org> For additional commands, e-mail: beginners-h...@perl.org <mailto:beginners-h...@perl.org> http://learn.perl.org/ -- a Andy Bach, afb...@gmail.com <mailto:afb...@gmail.com> 608 658-1890 cell 608 261-5738 wk
Re: Unescaped Left Brace
Thanks for pointing that out. I'll be darned. I need to check some of my scripts for this error. I'm not sure what I was trying to do with that. Probably eliminate very small files. $text is a read from a PDF file: This is what I wrote a long time ago: eval { ($text = $pdf->getPageText($page)); }; if ($@) { print "$date | Skipping $filename since it won't parse\n\n"; print OUT "$date | Skipping $filename since it won't parse\n\n" unless exists $log{$filename}; goto SKIP; } $text = "" unless defined $text; unless ($text =~ /[a-zA-Z]{,10}/s) { undef @lines; undef $texttemp; goto SKIP; } Because of this error I think all PDF files are eliminated from consideration, which is not a huge problem, but is not intended. Without doing a whole lot of thinking, I think I may change that one line to: unless ($text =~ /[a-zA-Z\s]{10,}/s) { Thanks for the response. Mike On 11/23/2017 8:31 AM, X Dungeness wrote: Hm, that's a misbegotten quantifier. From 5.26.0 perlreref: There is no quantifier "{,n}". That's interpreted as a literal string. On Thu, Nov 23, 2017 at 3:04 AM, Mike Flannigan <mailto:mikef...@att.net>> wrote: I recently installed the latest version of Strawberry Perl. My scripts were developed in ActiveState Perl. I have a line: unless ($text =~ /[a-zA-Z]{,10}/s) { When I run the script that line is in I get: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/[a-zA-Z]{ <-- HERE ,10}/ at htmlpost.pl <http://htmlpost.pl> line 316. I see this: http://www.perlmonks.org/?node_id=1104517 <http://www.perlmonks.org/?node_id=1104517> I also see that escaping it with my ActiveState Perl messes up it's function entirely, but still allows it to run with no errors so I say this is a huge problem. Seems like the migration to Perl 5.30 is going to be interesting to say the least. Anybody have any other comments about this? Mike Flannigan -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org <mailto:beginners-unsubscr...@perl.org> For additional commands, e-mail: beginners-h...@perl.org <mailto:beginners-h...@perl.org> http://learn.perl.org/
Unescaped Left Brace
I recently installed the latest version of Strawberry Perl. My scripts were developed in ActiveState Perl. I have a line: unless ($text =~ /[a-zA-Z]{,10}/s) { When I run the script that line is in I get: Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/[a-zA-Z]{ <-- HERE ,10}/ at htmlpost.pl line 316. I see this: http://www.perlmonks.org/?node_id=1104517 I also see that escaping it with my ActiveState Perl messes up it's function entirely, but still allows it to run with no errors so I say this is a huge problem. Seems like the migration to Perl 5.30 is going to be interesting to say the least. Anybody have any other comments about this? Mike Flannigan -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: "Information station" using Perl and Raspberry Pi
I can't be the best one to answer this, but I might be the only one that responds. What you want might be hard, though that would surprise me. That seems to be the consensus in this discussion: http://www.tomsguide.com/answers/id-1920620/cheapest-show-browser-long-term.html I have no direct experience with Raspberry Pi, but it seems clear it would probably work if you are abandoning the watching of TV on the set. I'd like to hear how this works out for you. Mike On 7/25/2017 2:21 PM, beginners-digest-h...@perl.org wrote: Subject: "Information station" using Perl and Raspberry Pi From: SSC_perl Date: 7/25/2017 2:20 PM To: Perl Beginners I'm looking to get some ideas on how to make an "information station" for my mother who has the beginning stages of dementia. I want to display information on her TV, like when her next meal is, time of day, date, etc., which of course would change daily and throughout the day. I was thinking that I'd get a Raspberry Pi and program that to retrieve text files from a server depending on the time of day. I don't know how well the RPi handles Perl - it seems to be geared for Python. I would need to be able to display text in any size and style. My first though was to use HTML, but I don't want to use a browser to display the text onscreen. Would this require a GUI, such as Tk? Has anyone done anything like this before? Am I on the right track with my ideas or is there a better way of doing this? Thanks, Frank
Re: IPC::Open3 and output
Thanks for that, now I have another issue. Unlike a piped open, open 3 does not seem to produce output immediately Is there any way to use pipes with open3 so that the FH has content before looping ie: this produces output my $pid=open($file, "-|","$cmd{$sopts->{subname}} 2>&1") while $pid=open3(undef,undef,$file,$cmdprog, @args) does not until you iterate over the FH thanks On 10 July 2017 at 07:13, Chas. Owens wrote: > On Sun, Jul 9, 2017, 19:37 Mike Martin wrote: > >> Hi >> I am trying to use Open3 to capture stderr and avoiding the shell ie: >> my $str="-v 35 -i /data/Downloads/testinput.mp4 -c:v libx264 -preset fast >> -crf 28 -g 25 -c:a libmp3lame -b:a 128000 -threads 4 -af volume=2.5 -vf >> scale='352:trunc(ow/((1/sar)*dar)/2)*2',fps='fps= 20',setsar='1/1' >> -profile:a aac_he_v2 -strict -2 -y /home/mike/testopen.mp4"; >> use Text::ParseWords; >> @args = quotewords('\s+', "'", $str); >> >> use IPC::Open3; >> >> local(*HIS_IN, *HIS_OUT, *ERR); >> my $cmd='ffmpeg'; >> my $pid=open3(undef, undef, *ERR,$cmd, @args) or die print "$!"; >> my $line; >> >> while (sysread ERR, $line, 256){ >> print $line; >> } >> waitpid($pid, 0); >> >> However the output is buffered for around 2 minutes at a time rather >> immediately being printed >> >> Is there any way around this >> > > Are you certain the buffering is in the read from ERR and not in the > print? STDERR is not supposed to be buffered. Try adding > > $| = 1; > Near the top of your program. That will turn off any buffering of the Perl > 5 script's STDOUT. > > By default, Perl 5 will buffer STDOUT if it isn't writing to a > pseudoterminal (eg if you are piping the output of the Perl 5 script to > something else like tee.) > > >
IPC::Open3 and output
Hi I am trying to use Open3 to capture stderr and avoiding the shell ie: my $str="-v 35 -i /data/Downloads/testinput.mp4 -c:v libx264 -preset fast -crf 28 -g 25 -c:a libmp3lame -b:a 128000 -threads 4 -af volume=2.5 -vf scale='352:trunc(ow/((1/sar)*dar)/2)*2',fps='fps= 20',setsar='1/1' -profile:a aac_he_v2 -strict -2 -y /home/mike/testopen.mp4"; use Text::ParseWords; @args = quotewords('\s+', "'", $str); use IPC::Open3; local(*HIS_IN, *HIS_OUT, *ERR); my $cmd='ffmpeg'; my $pid=open3(undef, undef, *ERR,$cmd, @args) or die print "$!"; my $line; while (sysread ERR, $line, 256){ print $line; } waitpid($pid, 0); However the output is buffered for around 2 minutes at a time rather immediately being printed Is there any way around this
Warnings when sorting by hashref
Hi I have the following code as an example against a hash of hashes, to sort by hashrf key foreach my $opt (sort {uc($options{$b}->{type}) cmp uc($options{$a}->{type})} keys %options){ my $type=$options{$opt}->{vtype}; $video_type->append_text($type) if defined($type) ; } The sort function works perfectly, however perl throws up the following warning for each line Use of uninitialized value in uc at Any ideas how to get rid of the warning thanks Mike
Re: Bad display of accents in Subject
I'm not sure this is the answer, but try Unicode::Collate http://stackoverflow.com/questions/7429964/how-to-match-string-with-diacritic-in-perl Mike On 3/19/2017 10:58 PM, beginners-digest-h...@perl.org wrote: Hello, when I run this script: (it's an excerpt) --begin test1.pl- #!/usr/bin/perl use strict; # use warnings; use Getopt::Std; use Net::POP3; use Term::ANSIColor qw(:constants); binmode(STDOUT, ":utf8"); my %params = (); getopts('s:l:p:', \%params); my $server = $params{s}; my $login = $params{l}; my $password = $params{p}; unless (defined $password) { my $trk_loaded = 0; eval { require Term::ReadKey; import Term::ReadKey; $trk_loaded = 1; }; print RED . ON_WHITE, 'Password: ', RESET; ReadMode('noecho') if $trk_loaded; # input echo off chomp($password = $trk_loaded ? ReadLine(0) : ); ReadMode('restore') if $trk_loaded; # input echo on print "\n"; } my $pop; eval { $pop = Net::POP3->new($server) } ; defined $pop or print <login($login, $password) }; defined $nmails or print < 0) { print "No mail for $login. Bye\n"; exit; } my @allmsg = (); my @taille = (); my @delete = (); # my @frompour = (); # my @subjectpour = (); my %messages = %{$pop->list}; while ( my ($msgnum, $size) = each %messages) { push @allmsg, $msgnum; } print "The number of messages for $login is: ", $#allmsg + 1, "\n"; # Get the headers. my ($from, $to, $subject); foreach my $msgnum (sort {$a <=> $b} @allmsg) { my $top = $pop->top($msgnum); next if not defined $top; my @lines = @$top; # Extract relevant headers. ($from) = grep /^From:/i, @lines; ($to) = grep /^To:/i, @lines; ($subject) = grep /^Subject:/i, @lines; } print "$subject" if defined $subject; --end test1.pl if the subject of a message contains accents, they do not display correctly. How can we solve the problem ? For example I get a message with the subject: Subject: L'�t� �a sera bient�t ./test1.pl -s pop.server.fr -l user The number of messages for user is: 1 Subject: =?iso-8859-1?Q?L'=E9t=E9_=E7a_sera_bient?= =?iso-8859-1?Q?=F4t?= tia.
Email Sender timeout with more than two paragraphs of text in body
Hi I have the below script (extracted pertinent bits). The connection to the mail server times out if there is more than about 10 lines of text (sometimes less) There is no issue with how many attachments I can send, so getting a bit stumped Example below with specimen text (anonymised) The body,subject and address come via a sqlite db lookup run by a Gtk app. And it is a subscribers list so definitely not spam. Any ideas appreciated $text =" Talk and Walk for Our NHS Friday 7th October. MEETING 4.30 to 6.30 Our Plans for Our NHS: as Derbyshire community hospitals and wards are threatened with closure, the Big Plan (STP) is to slash Derbyshire's health spending by £400 million over the next 5 years. We can't let this happen. Join us at Belper Strutts, Derby Road. (DE56 1UU) Saturday 8th October. WALK ACROSS DERBYSHIRE/SAVE OUR NHS. Leave Belper Market Place at 10.00. Leave Bakewell Park at 10.00. Walk to Matlock County Hall for Rally at 3.00. Or join us on the way. Derbyshire Keep Our NHS Public: ...@gmail.com Tuesday 11th October, 7.30 Derby Guildhall Townsend Theatre's moving, funny, powerful play about the Spanish Civil War. "Dare Devil Ride to Jarama." Tickets (£10.75) from http:// x@xx or phone x Derby People's History." use Net::SMTP::SSL; use MIME::Base64; use Email::Sender::Simple qw(sendmail); use Email::MIME; use IO::All; use Email::Sender::Transport::SMTPS; sub sendemail { my ($fname,$email,$rowid,$momstatus,$labstatus,$subject,$body)=@_; print $fname,"\t",$email,"\t",$subject,"\t",$rowid,"\t",$status1,"\t",$status2,"\n"; my $message; $message= " Hi $fname $body"; print $rowid,"\n",'lp_status'."\t",$labstatus,"\t".'momstatus'."\n"; my $footer; if (){ $footer="\n x xxx, "; } if (check2){ $footer=$footer."\nxxx, } my @attachments= qw/attachments go here/; my @parts; push @parts,Email::MIME->create( body => $message."\n".$footer, attributes=>{content_type =>'text/plain'} ); foreach my $line (@attachments){ my $mime=`file --mime-type $line`; my @type=split /: /,$mime; chomp $type[1]; my $mime_type=$type[1]; push @parts, Email::MIME->create( body => io('/home/mike/'.$line)->binary->all, attributes => { encoding=>'base64', filename => $line, content_type => $mime_type, name=>$line, disposition => 'attachment' } ) } $message=$body."\n".$footer; my $multi = Email::MIME->create( header_str => [ To => $email, From => 'm.mar...@momentumderbyshire.co.uk', 'Reply-To' => 'm.mar...@momentumderbyshire.co.uk', 'List-Unsubscribe'=>'m.mar...@momentumderbyshire.co.uk', 'Disposition'=>'bulk', Subject => $subject ], parts => [@parts, ], ) ; my $transport = Email::Sender::Transport::SMTPS->new( host => 'mail.momentumderbyshire.co.uk', port => 587, sasl_username => 'm.mar...@momentumderbyshire.co.uk', sasl_password => 'M0m3ntum16', debug => 0, # or 1} ); sendmail ($multi, {transport=>$transport}); } -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: XML::Simple Umlaute
I'm not sure if it is possible to use Umlaute in XML Files or not. Maybe this post with help you: http://stackoverflow.com/questions/11772468/reading-xml-files-with-umlaut-chars Is there a way to change encoding to "iso-8859-1"? Mike On 7/28/2016 8:03 AM, beginners-digest-h...@perl.org wrote: Hi, I would like to read XML files which look like this: uuid:ee1bd852-37ee-4965-a097-50130cf6dac7 Infostand 5449000134264 groß 5449000134264 5449000134264 10.0 20 There is an Umlaut, ß, supposed to be at groß which is apparently impossible to read. The following program ... #!/usr/bin/perl use strict; use warnings; use feature 'say'; use XML::Simple; use Data::Dumper; my $xml = new XML::Simple; my $data = $xml->XMLin("test.xml"); open my $fh, ">", 'pout'; print $fh Dumper($data); close $fh; print Dumper($data); exit 0; ... gives me this output: $VAR1 = { 'Bezeichnung1' => {}, 'id' => 'build_Inventur_1469705446', 'Stationsnummer' => 'Infostand', 'meta' => { 'content' => 'text/html; charset=UTF-8', 'http-equiv' => 'content-type', 'instanceID' => 'uuid:ee1bd852-37ee-4965-a097-50130cf6dac7' }, 'Mitarbeiter_inv' => '5449000134264', 'Regaletikett_ausgeben' => "gro\x{df}", 'Erfassung' => { 'Artikelstapel' => { 'Menge' => '20', 'Preis' => '10.0', 'EAN_Artikel' => '5449000134264', 'Etikettentyp' => {} }, 'Artikel_erfassen' => {}, 'Lagerstaette' => '5449000134264' } }; I´m not getting any better results when adding an encoding tag to the XML file and when writing the Dumper output to a file. Is it impossible to use Umlaute in XML Files?
Re: reading directories using perl in windows
FYI, there is no error. If the directory path has no spaces it works fine, if the directory path has spaces it prints the path up to the 1st space and just goes back to a cursor line. Mike On 3/6/2016 5:04 AM, beginners-digest-h...@perl.org wrote: Subject: Re: reading directories using perl in windows From: Akshay Mohit Date: 3/1/2016 4:49 AM To: Arghya Das CC: Perl Beginners Could you please send the exact error which you are getting as I Copy/Pasted the exact code which you had given and it is working properly for me. I have only given the directory which is present in my system. use strict; use warnings; my $dir = "C:/Python_Exercise/*"; my @files = glob( $dir ); foreach (@files ){ print $_ . "\n"; }
Re: Is perl user specific
Please use the Reply All feature so that your replies get sent to the mailing list. On Wed, Jan 6, 2016 at 11:21 AM, Ankita Rath wrote: > Okay I will try it.. Thank u > > Ankita > On 6 Jan 2016 22:44, "Mike D" wrote: > >> In the future, please use the Reply All feature. >> >> So, run `echo $PATH` on both users. >> >> If the path for the Perl executable is different for the user in which >> the script works, try editing the path variable for the user in which it >> doesn't to use the path to the working Perl executable: >> >> http://superuser.com/questions/488173/how-can-i-edit-the-path-on-linux >> >> On Wed, Jan 6, 2016 at 10:15 AM, Ankita Rath >> wrote: >> >>> Thank you. But code is exactly same for both of us. Is there any user >>> specific system file where perl path has to be added? >>> >>> On Wed, Jan 6, 2016 at 9:09 PM, wrote: >>> >>>> Hello, >>>> >>>> I would assume that you have multiple versions of Perl installed and >>>> that the other user has the "working version" in their path, while this >>>> user has a different version in theirs. >>>> >>>> Sent from my iPhone. >>>> >>>> On Jan 6, 2016, at 9:34 AM, Ankita Rath >>>> wrote: >>>> >>>> Hi all, >>>> >>>> I am trying to execute some perl scripts. I am getting following error. >>>> But other user in the same server are not getting the error. So can anybody >>>> help me understanding this problem. And why other user are not getting the >>>> error. >>>> >>>> Perl 5.008003 required--this is only version 5.00503, stopped at >>>> ../Modules/Modules_64/5.8.5/x86_64-linux-thread-multi/YAML/XS.pm line 26. >>>> BEGIN failed--compilation aborted at >>>> ../Modules/Modules_64/5.8.5/x86_64-linux-thread-multi/YAML/XS.pm line 26. >>>> >>>> Regards, >>>> Ankita >>>> >>>> >>>> >>>> >>>> >>>> >>> >>
Re: Is perl user specific
In the future, please use the Reply All feature. So, run `echo $PATH` on both users. If the path for the Perl executable is different for the user in which the script works, try editing the path variable for the user in which it doesn't to use the path to the working Perl executable: http://superuser.com/questions/488173/how-can-i-edit-the-path-on-linux On Wed, Jan 6, 2016 at 10:15 AM, Ankita Rath wrote: > Thank you. But code is exactly same for both of us. Is there any user > specific system file where perl path has to be added? > > On Wed, Jan 6, 2016 at 9:09 PM, wrote: > >> Hello, >> >> I would assume that you have multiple versions of Perl installed and that >> the other user has the "working version" in their path, while this user has >> a different version in theirs. >> >> Sent from my iPhone. >> >> On Jan 6, 2016, at 9:34 AM, Ankita Rath wrote: >> >> Hi all, >> >> I am trying to execute some perl scripts. I am getting following error. >> But other user in the same server are not getting the error. So can anybody >> help me understanding this problem. And why other user are not getting the >> error. >> >> Perl 5.008003 required--this is only version 5.00503, stopped at >> ../Modules/Modules_64/5.8.5/x86_64-linux-thread-multi/YAML/XS.pm line 26. >> BEGIN failed--compilation aborted at >> ../Modules/Modules_64/5.8.5/x86_64-linux-thread-multi/YAML/XS.pm line 26. >> >> Regards, >> Ankita >> >> >> >> >> >> >
Re: sure would be nice if Perl had trace command built-in
On 12/10/2015 5:40 AM, beginners-digest-h...@perl.org wrote: On Mon, Dec 7, 2015 at 6:33 PM, Brock Wilcox wrote: >Give devel::trace or devel::tracemore a try:) Is it possible to install this from Active State repository without having an-up-date ActiveState Perl DevKit license? Thanks, Ken Wolcott FYI, my ActiveState PPM ver 4.17 pointed to repository: http://ppm4.activestate.com/MSWin32-x64/5.16/1603/package.xml does list Devel-Trace version 0.12. I did not try to install it. I have never had an ActiveState Perl DevKit license, or certainly didn't pay for it. Mike
Re: uniq array creation
See if this meets your needs: http://www.arl.wustl.edu/projects/fpx/references/perl/cookbook/ch04_07.htm Mike On 11/25/2015 1:53 AM, beginners-digest-h...@perl.org wrote: Hi I want to create a unique array . I have the code below. It is creating a array which will have duplicate data . How can I filter duplicate data ? #!/usr/bin/perl use Data::Dumper; #my $cnt = scalar @$net_int_parsed_output; $net_int_parsed_output = [lif_1 ,lif_2,lif_3,lif_4,lif_1,lif_2]; foreach my $n (@$net_int_parsed_output){ my $lif_cnt++; print "lif of vserver >>> $n\n"; push (@{$lun_PR_resv_info->{'lun'}->{'vserver'}->{'fcp_lifs'}},$n); } print "lun PR resv related info>>>>>>>>>>>>>",Dumper $lun_PR_resv_info,"\n"; Thanks Sunita
Re: converting Genbank format in gff format
On 8/20/2015 4:01 AM, beginners-digest-h...@perl.org wrote: Subject: Re: converting Genbank format in gff format From: John SJ Anderson Date: 8/17/2015 10:03 PM To: Perl Beginners On Mon, Aug 17, 2015 at 3:58 PM, Uri Guttman <mailto:u...@stemsystems.com>> wrote: On 08/17/2015 03:57 AM, atteyet-alla.yas...@ukb.uni-bonn.de <mailto:atteyet-alla.yas...@ukb.uni-bonn.de> wrote: hi all, is there a possibilty to convert Genbank format in gff format using perl? I installed perl5 in my linux. Atteyet-Alla -- there's a 'genbank2gff' script in the Bioperl dist, perhaps that at least gives you some hints on where to start? Code is here: https://metacpan.org/source/CJFIELDS/BioPerl-1.6.924/scripts/Bio-DB-GFF/bp_genbank2gff.pl You'll need to install the Bioperl module. the answer is yes, perl can convert anything into anything. that is true for most if not all languages. do you have more questions? Wow, Uri, do you suppose Perl could convert your smug condescending answer into something useful? Geez. Maybe a bit snotty, but I don't fault somebody for answering a question accurately. Maybe the OP is not aware of CPAN. I suggest he do a DDG search for CPAN. Good think he is on Linux, because Activestate does not have anything on "Genbank" or "gff". Mike
problem with regex qr operator
Hi I am currently getting issues with regexes that use the qr operator. The results with qr are different than without. This is a small sample program to illustrate it use strict; my $str='Database Administrator'; my $pattern= '(?=^(?:(?!(?:datab|network|system)).)*$).*(?:Adm(?:in(?:i?strat(?:ors?|ion|ive)?)?)?|Clerk\b|Clerical|office)(?:.*?ass.*?|supp|temp|staff|officer?|).*?' ; my $pattern2=qr/$pattern/; $str=~/($pattern)/i; print 'no qr',"\t", $1,"\n"; $str=~/($pattern2)/i; print 'with qr',"\t", $1,"\n"; print 'Pattern without qr',"\t",$pattern,"\n"; print 'Pattern without qr',"\t",$pattern2,"\n"; Explanation of pattern '(?=^(?:(?!(?:datab|network|system)).)*$) - looks for datab|network|system and then negates the match within the entire string .* - winds the match back to start of string (?:Adm(?:in(?:i?strat(?:ors?|ion|ive)?)?)?|Clerk\b|Clerical|office)(?:.*?ass.*?|supp|temp|staff|officer?|).*?' - looks for match In this example the phrase "Database Administrator" fails the regex without qr (as it should), but if I use qr it passes giving wrong result this is the output of of the last two lines Pattern without qr (?=^(?:(?!(?:datab|network|system)).)*$).*(?:Adm(?:in(?:i?strat(?:ors?|ion|ive)?)?)?|Clerk\b|Clerical|office)(?:.*?ass.*?|supp|temp|staff|officer?|).*? Pattern without qr (?^:(?=^(?:(?!(?:datab|network|system)).)*$).*(?:Adm(?:in(?:i?strat(?:ors?|ion|ive)?)?)?|Clerk\b|Clerical|office)(?:.*?ass.*?|supp|temp|staff|officer?|).*?) The only difference I can see is the addition of a non-capturing group around the expression (?^:) Anyone any idea what is happening here -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Getting 2/8 as output
Thank you. I stand corrected. Interestingly, if you do "perldoc -q $," it does not explain $, but instead goes into some system with >> as the prompt. Mike On 6/17/2015 8:43 AM, Andy Bach wrote: Actually there is a $, - array display separator. http://perlmaven.com/output-field-separator-and-list-separator On Wednesday, June 17, 2015, Mike Flannigan <mailto:mikef...@att.net>> wrote: If I am not mistaken there is no $, variable in Perl. Correct me if I am wrong. I suspect that was supposed to be $/. Mike
Re: Getting 2/8 as output
If I am not mistaken there is no $, variable in Perl. Correct me if I am wrong. I suspect that was supposed to be $/. Mike On 6/17/2015 7:32 AM, beginners-digest-h...@perl.org wrote: { local $, = "\n"; print %test; } -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: [Bulk] Re: Fwd: Re: LWP/Protocol Errors
On 5/27/2015 7:46 AM, Lawrence Statton wrote: On 05/27/2015 07:33 AM, Mike Blezien wrote: *CONNECTED(0003) --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 0 bytes and written 0 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE ---* Yeah - I retract everything I've thus far said -- that's pretty clear evidence that you're not getting the SSL handshake started. That's what I thought. Will check that the port is open on that server and try again. thanks, Mike -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Fwd: Re: LWP/Protocol Errors
On 5/25/2015 12:31 PM, Lawrence Statton wrote: I sent this to the list, but it seems to have gotten clogged in the tubes ... here's another copy Forwarded Message Subject: Re: LWP/Protocol Errors Date: Mon, 25 May 2015 12:13:11 -0500 From: Lawrence Statton To: beginners@perl.org On 05/25/2015 12:02 PM, Mike Blezien wrote: Hello, I recently setup a Paypal IPN script which worked fine for some time now but now all of a sudden I keep getting these error message: * **Can't connect to www.paypal.com:443 (certificate verify failed)** **LWP::Protocol::https::Socket: SSL connect attempt failed with unknown error error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at /usr/local/share/perl5/LWP/Protocol/http.pm line 41. *I use same IPN script on other servers without any issues except one. Is it possible that port 443 is being block or not open due a firewall on the server? Any suggestion would be appreciated. -- While it is *POSSIBLE* that a blocked port is causing your grief, that is not the most likely explanation. Has it *NEVER* worked on this server, or worked until recently? Your email was vague on this point. The exact error is telling you that the OpenSSL library (which is ultimately where LWP gets its SSL support) cannot verify the origin of the certificate chain that Paypal is offering. Compare the contents of /etc/ssl/certs (the exact directory will vary based on which Linux distribution you are using, but it will be something similar) on a 'working' server with the 'not-working' server. openssl s_client will allow you to attempt a connection and turn on substantial diagnostics to see the certificate that is being offered by the server, and (most importantly) the issuer for that certificate and the issuer's hash -- which will lead you to find the correct CA cert you need to add. (Alternatively, if your problem *is* a blocked port, you will get enough diagnostic from s_client to show you that it can't even GET the server's cert -- but the error message makes me 99% certain that you are already past that point in the SSL handshake) After further investigation running the following command from the shell prompt: openssl s_client -host paypal.com -port 443 I get these results: CONNECTED(0003) --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 0 bytes and written 0 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE --- This is first time using this paypal script on this server and has not worked yet. I've used similar script on other servers without issues or other problems. Is this a port issue or something else? thanks, Mike -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: LWP/Protocol Errors
On 5/25/2015 12:27 PM, Lawrence Statton wrote: On 05/25/2015 12:02 PM, Mike Blezien wrote: Hello *I use same IPN script on other servers without any issues except one. Is it possible that port 443 is being block or not open due a firewall on the server? Another tidbit of information that just burbled to the top of my brain. On SOME platform (but I can't remember which now) when LWP was compiled to use openssl, the builder elected not to have ANY default CA path. This will require you to explicitly set the PERL_LWP_SSL_CA_PATH environment variable (or the 'all-in-one file variant'- read perldoc LWP ) to point to the local store of CA certificates. Ok thank you I'll check this out. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/