Re: A Regular Expression Problem in Perl 5.28

2023-03-28 Thread Uri Guttman
On 3/28/23 16:17, Martin McCormick wrote: The string I am interested in testing for starts with 5 or 6 digits in a row and all I need to do is determine that the first 5 or 6 characters are numbers Period. That's all. my $regextest = '/^\d+\{5,\}/' ; why are you escaping the {}??

Re: socket recive problem

2021-04-02 Thread Uri Guttman
On 4/2/21 4:47 AM, stefano cerbioni wrote: hi i try to recive  a stream string  by  a client (write in C++) , if i use netcat ,  work ok but  when i use a  script in perl work partially , recive "Connection recieved from $name\n";,  but  $name is  blank , why ?? thanks this is a script

Re: Perl script: where was I executed from?

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

Re: Perl script: where was I executed from?

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

Re: Perl script: where was I executed from?

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

Re: question about perl script

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

Re: symlink to "pack"

2019-09-07 Thread Uri Guttman
On 9/7/19 8:35 PM, Mike wrote: 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' symlink and link are very different functions so changing it likely won't help. see my other

Re: symlink to "pack"

2019-09-07 Thread Uri Guttman
On 9/7/19 4: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

Re: Geo::WebService::Elevation::USGS

2019-08-26 Thread Uri Guttman
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:

Re: What are these numbers (gmtime, slice)

2019-07-08 Thread Uri Guttman
On 7/8/19 4:00 PM, Mike Small wrote: 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 th

Re: What are these numbers (gmtime, slice)

2019-07-07 Thread Uri Guttman
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

Re: stupid question about to protect source code of perl web application scripting

2019-07-06 Thread Uri Guttman
On 7/6/19 11:21 PM, Eko Budiharto wrote: dear Uri, it is a web application but it is on premise. The user is not honest. That's why I am trying to find a way to protect the source code like in java we can compile into java class and still can be run. I read some articles in the internet.

Re: stupid question about to protect source code of perl web application scripting

2019-07-06 Thread Uri Guttman
On 7/6/19 11:10 PM, Eko Budiharto wrote: dear Uri, it is a web application but it is on premise. The user is not honest. That's why I am trying to find a way to protect the source code like in java we can compile into java class and still can be run. please write to the list and not only to

Re: stupid question about to protect source code of perl web application scripting

2019-07-06 Thread Uri Guttman
On 7/6/19 11:01 PM, Eko Budiharto wrote: dear all, I have a question. I have written a web application with perl, unfortunately everything written in perl, everyone can see all source codes I wrote. My question is is there anyway to protect those source codes? Compile or encrypt it? if

Re: Is there a definition of what is a string in perl, and what is it?

2019-05-21 Thread Uri Guttman
On 5/21/19 8:10 AM, hwilmer wrote: I'm not overthinking anything.  I was trying to find out if what currently happens to work under given conditions does so by chance or luck, or if I can be reasonably sure that it was done right because it is how things work, and it will work under different

Re: Is there a definition of what is a string in perl, and what is it?

2019-05-17 Thread Uri Guttman
On 5/17/19 9:49 AM, hwilmer wrote: That means "binary data", like you would allocate some memory in C to read a file into (like a jpeg image in my application) or perhaps use a vector of a suitable data type in C++ for such data, or maybe an array. Despite being a useful simplification,

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

2019-03-12 Thread Uri Guttman
On 3/12/19 11:59 AM, Frank K. wrote: Greeting, In the infinite wisdom our company, without warning completely uninstalled Active Perl on all of our Windows servers (I believe it was v5.8).. They claimed it was a security risk, but I suspect new licensing fees were the main incentive..

Re: reading text data to variable

2018-12-28 Thread Uri Guttman
On 12/26/18 12:40 PM, Eldon DeHart wrote: I can't figure out how to read each line of text back into my program and assign it to the variable again. Thanks for help in advance. Eldon please show us the code you have and then we can better help guide you. also read the FAQ as that is likely

Re: How to test for existence of file with non-ascii characters

2018-12-26 Thread Uri Guttman
On 12/26/18 7:31 AM, Mike Martin wrote: 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 -e should not be looking at the filename directly. it checks if

Re: Test

2018-11-03 Thread Uri Guttman
On 10/27/18 6:27 AM, Shravan Uppin wrote: Hi do anyone know how to substitute for string in complex hashes i am not sure what you mean with that question. a string substition (the s/// op) can be done on any scalar. if you can access the scalar in a complex hash, you can do an s/// on it.

Re: use Time::Piece

2018-10-30 Thread Uri Guttman
On 10/30/18 11:24 PM, Martin McCormick wrote: I can not seem to send Time::Piece any syntax it likes. The file I am reading sends a time stamp that should conform to RFC822 date stamps. An example of a stamp follows: main::(lwx:204):my @obtime = split( /\,+/,

Re: data structure for Template Toolkit

2018-10-29 Thread Uri Guttman
On 10/28/18 4: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

Re: slipping through my sieve

2018-09-10 Thread Uri Guttman
On 09/10/2018 12:59 PM, Rick T wrote: I love this mailing list! Once again, Uri, thank for your fruitful suggestions. It took me an afternoon of googling to understand them, but I see now that your suggestions are indeed “cleaner code” and I will implement them from now on. Mostly I want

Re: slipping through my sieve

2018-09-09 Thread Uri Guttman
On 09/09/2018 02:11 PM, Rick T wrote: I don’t know whether my difficulty is with my perl or with my logic; but either way I need a fresh mind on this. If I test the subroutine by feeding it a file name that does not exist in any format, I expect it to die — but it does not. Any good ideas

Re: reading form values from POST

2018-09-02 Thread Uri Guttman
On 09/02/2018 05:04 PM, Rick T wrote: I am trying to wean myself from CGI.pm, an easy task for most of you, but I am a beginner. The code below works, but that does not mean it always will or that it cannot be improved. I found the main part of this in CGI Programming with Perl, which is 18

Re: slurp error

2018-07-27 Thread Uri Guttman
On 07/27/2018 02:37 PM, Rick T wrote: I tried to implement some advice about slurping that I read on this mailing list (using local) but cannot get it to work. I get the message “Value of construct can be "0"; test with defined() at line 23” (the $slurp = <$fh1> line). I’m using perl version

Re: about system() call

2018-07-24 Thread Uri Guttman
On 07/24/2018 09:56 PM, Lauren C. wrote: Thanks for all kind answers. I have another question that, though this is maybe hard, I want to resize batch of images, from the large scale to small one, i.e, this image: https://miscnote.net/wp-content/uploads/2018/07/lauren.jpg (sorry but this is

Re: about system() call

2018-07-24 Thread Uri Guttman
On 07/24/2018 08:35 AM, Lauren C. wrote: Hi, $ perl -le 'system "df -h"' $ perl -le 'system "df","-h"' The both two styles work fine. what's the difference between them and which is better usage? this is a more technical answer than the others but it may be useful to you or other readers.

Re: help with another regex

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

Re: help with another regex

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

Re: help with a stat script

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

Re: help with a stat script

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

Re: interpolation without double quotes

2018-07-04 Thread Uri Guttman
On 07/04/2018 10:16 AM, Rick T wrote: The following line works, even though I forgot to double quote the variable. my $student_directory =  '/data/students/' . $student_id; When I noticed this, I thought this was convenient: perl is trying to “do the right thing.” But I worry that leaving

Re: Regex for date format

2018-06-29 Thread Uri Guttman
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

Re: Regex for date format

2018-06-29 Thread Uri Guttman
On 06/29/2018 09:32 AM, Mike Martin wrote: 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 not sure what you are trying to do. show the after text that you want. a proper

Re: Help debugging some old Bugzilla perl scripts

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

Re: Help debugging some old Bugzilla perl scripts

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

Re: Help debugging some old Bugzilla perl scripts

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

Re: obstinate syntax errors

2018-01-19 Thread Uri Guttman
On 01/19/2018 01:43 PM, Darryl Philip Baker wrote: I don't have the time to put everything around this to do the syntax test but what happens with this: If ( ! chdir "/big/dom/x$server/data/students/$progress_hash{student_id}/" ) { $message = "Can't change directory to

Re: obstinate syntax errors

2018-01-19 Thread Uri Guttman
On 01/19/2018 12:44 PM, Rick T wrote: The subroutine below produces the following syntax errors: syntax error at /big/dom/xexploringmyself/cgi-bin/register.cgi line 71, near ""Can't change directory to $progress_hash{student_id}: $!";" syntax error at

Re: Use of uninitialized value for perl

2017-11-04 Thread Uri Guttman
On 11/04/2017 08:43 PM, Dong Liu wrote: I try used perl script to get characters from data: #!/usr/bin/perl -w use v5.14; while (){ chomp; my $line = ''; $line = (split //,@_)[5]; You are using @_ which is the array of args to a sub. you aren't in a sub there. also you shouldn't

Re: OOP: a class using a class that is descended from it?

2017-08-04 Thread Uri Guttman
On 08/04/2017 11:51 AM, hw wrote: Huh? How many package statements is a module supposed to contain? And doesn´t a package statement turn a module into a package? package statements and files are independent! a package statement only sets the default namespace for code that follows it until

Re: Fwd: Re: dangerous perl (Re: is this reasonably save?)

2017-05-25 Thread Uri Guttman
On 05/25/2017 01:33 PM, lee wrote: Uri Guttman <u...@stemsystems.com> writes: On 05/24/2017 08:20 PM, lee wrote: Uri Guttman <u...@stemsystems.com> writes: you can get an array of hashes, where each hash is one row. learning dereferencing will do you much more good than usi

Fwd: Re: dangerous perl (Re: is this reasonably save?)

2017-05-24 Thread Uri Guttman
private IMO> On 05/24/2017 08:20 PM, lee wrote: Uri Guttman <u...@stemsystems.com> writes: you can get an array of hashes, where each hash is one row. learning dereferencing will do you much more good than using eval EXPR. references are key to deeper data structures in perl and

Re: is this reasonably save?

2017-05-14 Thread Uri Guttman
On 05/14/2017 02:00 PM, lee wrote: Uri Guttman <u...@stemsystems.com> writes: On 05/13/2017 09:08 PM, lee wrote: Hi, would you say this acceptable or something that should be forbidden? my $sth_cmds = $dbh->prepare_cached($sql); my @params; push(@params, undef) foreach(0..12);

eval vs eval

2017-05-14 Thread Uri Guttman
On 05/14/2017 08:02 AM, Shawn H Corey wrote: On Sun, 14 May 2017 02:08:11 +0100 lee wrote: I haven't used 'eval' before, and this seems inherently dangerous. eval EXPR; eval; These are dangerous. eval BLOCK This is not. just to clarify and add to shawn's

Re: is this reasonably save?

2017-05-13 Thread Uri Guttman
On 05/13/2017 09:08 PM, lee wrote: Hi, would you say this acceptable or something that should be forbidden? my $sth_cmds = $dbh->prepare_cached($sql); my @params; push(@params, undef) foreach(0..12); $sth_cmds->execute(); $sth_cmds->bind_columns(eval join(', ', map('\$params[' . $_ . ']',

Re: How to delete multiple indices from array

2017-04-12 Thread Uri Guttman
On 04/12/2017 07:29 PM, Shawn H Corey wrote: On Wed, 12 Apr 2017 18:16:56 -0400 Uri Guttman <u...@stemsystems.com> wrote: It's not about saving time. It's about removing a bug. In the code below, notice that there are two different outputs depending on the order that splice is applied

Re: How to delete multiple indices from array

2017-04-12 Thread Uri Guttman
On 04/12/2017 05:42 PM, Shawn H Corey wrote: On Wed, 12 Apr 2017 16:19:32 -0400 Uri Guttman <u...@stemsystems.com> wrote: my @array; for my $index (reverse sort @indices) { sort defaults to a lexical sort which won't work well on integers with more than 2 digits. and why are you s

Re: How to delete multiple indices from array

2017-04-12 Thread Uri Guttman
On 04/12/2017 04:38 PM, Shlomi Fish wrote: Hi Uri! Some notes. On Wed, 12 Apr 2017 15:19:33 -0400 Uri Guttman <u...@stemsystems.com> wrote: On 04/12/2017 03:00 PM, David Emanuel da Costa Santiago wrote: Hello! What's the best way to delete multiple indices from an array? i'm

Re: How to delete multiple indices from array

2017-04-12 Thread Uri Guttman
On 04/12/2017 04:08 PM, Илья Рассадин wrote: Hi! You can use splice to delete elements from array. To delete multiple elements you need to do splice in a loop my @indices = qw/2 4 5 7/; why are you using qw which makes strings and not a list of integers? my @array; for my $index

Re: How to delete multiple indices from array

2017-04-12 Thread Uri Guttman
On 04/12/2017 04:01 PM, David Emanuel da Costa Santiago wrote: Thanks for your reply. I didn't think about that! :-) While i was reading your email, i remembered about splice, so i guess i'm going to end up with: -- my @array=qw/zero one two three four five six seven eight nine ten/;

Re: How to delete multiple indices from array

2017-04-12 Thread Uri Guttman
On 04/12/2017 03:00 PM, David Emanuel da Costa Santiago wrote: Hello! What's the best way to delete multiple indices from an array? i'm doing: --- my @array=qw/zero one two three four five six seven eight nine ten/; my @indicesToDelete = (2,4,6,7); if you have the indexes to

Re: Scalar References - oxymoron?

2017-04-03 Thread Uri Guttman
On 04/03/2017 06:52 PM, SSC_perl wrote: Reading http://perldoc.perl.org/perlreftut.html I see it’s possible to create a scalar reference. What situation would require someone to create a reference to a scalar? I thought refs were only useful for passing complex data structures. Is

Re: Perl Critic and subroutine signatures

2017-03-29 Thread Uri Guttman
On 03/29/2017 01:32 PM, SSC_perl wrote: On Mar 29, 2017, at 10:19 AM, Uri Guttman <u...@stemsystems.com <mailto:u...@stemsystems.com>> wrote: i would ask why are you using prototypes? I’m not using prototypes. I’m using subroutine signatures. Perl Critic only thinks they ar

Re: Perl Critic and subroutine signatures

2017-03-29 Thread Uri Guttman
On 03/29/2017 01:16 PM, SSC_perl wrote: Does anyone know how to keep Perl Critic from complaining about subroutine signatures? I’m getting a massive amount of these types of warnings: Subroutine prototypes used at line... i would ask why are you using prototypes? they are rarely useful

Re: how to recursion

2017-03-28 Thread Uri Guttman
On 03/28/2017 09:25 PM, PYH wrote: Hi, what's the better way to write a recursion in perl's class? sub my_recursion { my $self = shift; if (...) { $self->my_recursion; } } this one? i am not sure what you mean by better. your code would work if you finished it

Re: Equivalents statements using if and unless

2017-03-28 Thread Uri Guttman
On 03/28/2017 04:46 PM, SSC_perl wrote: I could use another set of eyes on this. Could someone please double check these two sets of conditions and let me know if the first is equivalent to the second? I believe they are, but I don’t want to take any chances. # Both of these should

Re: interesting regex delimiters

2017-02-23 Thread Uri Guttman
On 02/23/2017 05:19 PM, Andrew Solomon wrote: Running Perl 18.2 I was surprised to discover that I can use single and double quotes as regex delimiters without the 'm' operator. For example, instead of writing "/usr/bin/perl" =~ m"/perl" I can just write "/usr/bin/perl" =~ "/perl"

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread Uri Guttman
On 02/21/2017 05:12 PM, David Precious wrote: On Tue, 21 Feb 2017 09:11:10 -0800 SSC_perl <p...@surfshopcart.com> wrote: On Feb 21, 2017, at 8:34 AM, Uri Guttman <u...@stemsystems.com> wrote: you can't trace it from the value. but you can write code where that value is stuffed

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread Uri Guttman
On 02/21/2017 11:28 AM, SSC_perl wrote: In a MySQL db I have a `customers` table with a field called `hide`. There are some strange values that I’d like to know where they’re coming from. In most records `hide` is blank, some others have the value ‘1’, but a handful have values like

Re: Declaring and conditionally assigning to a variable on the same line

2017-02-15 Thread Uri Guttman
On 02/15/2017 01:39 PM, SSC_perl wrote: I’ve read where writing a one-liner like this is frowned upon: my $show_ref = delete $log{'show_ref'} if (exists $log{'show_ref'}); there is no need to check for existence when doing delete. it will return undef if it doesn't exist. and also

Re: dereferencing an object

2016-11-07 Thread Uri Guttman
On 11/07/2016 10:55 PM, derr...@thecopes.me wrote: I have an object that I am receiving from LWP::UserAgent::Post that looks like the below, there is more but this is the important part. Am I correct in saying this is an array of hashes in a hash? I want to get some of the values of the 0

Re: Email Sender timeout with more than two paragraphs of text in body

2016-10-03 Thread Uri Guttman
On 10/03/2016 06:51 AM, Mike Martin wrote: 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) i can't debug your email problem but there are several things you can do to help

Re: Data type of attributes

2016-09-29 Thread Uri Guttman
On 09/29/2016 03:52 PM, Aaron Wells wrote: Hi Klaus, Have you tried this? ref $some_obj; # should give your class name as a string Doubtless Uri will find something wrong with this  glad you asked! :) ref will return the class something is blessed into. reftype (in Scalar::Util) will

Re: wickedcoolperlscripts help

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

Re: calculate within a loop

2016-09-12 Thread Uri Guttman
On 09/12/2016 06:48 PM, Aaron Wells wrote: @Jim, That eval bit i think Nathalie got from me. I need to review my core Perl. I think i’m in the habit of assuming Perl warns against any usage of undefined values, even in boolean context. Not so. I’ve proven to myself that this is not the case:

Re: Remove Newlines from String

2016-09-06 Thread Uri Guttman
On 09/06/2016 04:42 PM, X Dungeness wrote: It's kinda hard to see but I included the /x switch because I inserted blanks on the pattern as well as the replacement side. Without /x, the match will fail. $str =~ s{ ([^[:print:]]) }{ sprintf( "(%#2X)", ord $1) }gex; ^

Re: Remove Newlines from String

2016-09-06 Thread Uri Guttman
On 09/06/2016 03:59 PM, X Dungeness wrote: $str = "ab\rcd\nef\ngh\fij"; $str =~ s{ ([^[:print:]]) }{ sprintf( "(%#2X)", ord $1) }gex; > ab(0XD)cd(0XA)ef(0XA)gh(0XC)ij that is a nice use of /e (don't think you need /x when you already have /e as code can handle blanks. but the #

Re: Interpolation Problem

2016-07-16 Thread Uri Guttman
On 07/15/2016 11:42 PM, AC P wrote: Hello Perl gurus, I'm hoping someone here can provide a solution since I'm stuck. I'm trying to send TL1 commands resembling "RTRV-ALM-ALL;" (the simplest command you can send as an example here) via Net::SSH::Expect but they keep getting interpolated

Re: search and replace

2016-06-29 Thread Uri Guttman
On 06/29/2016 01:17 PM, Eric de Hont wrote: Op 29-06-16 om 18:20 schreef Uri Guttman: On 06/29/2016 06:03 AM, Eric de Hont wrote: sub slurp_file { my $file = shift; local $/; open my $fh, '<', $file or die "Can't open $_: $!\n"; $_ is not set anywhere. you likely

Re: search and replace

2016-06-29 Thread Uri Guttman
On 06/29/2016 06:03 AM, Eric de Hont wrote: Op 29-06-16 om 06:35 schreef Danny Wong: Hi Perl GURUs, I have a json file that needs parsing. Here is a typical string I’m searching for. I want to delete everything but the last 2 character “],”. ], [ "ansible",

Re: Script runs slower with better hardware

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

Re: This is one of the things ...

2016-05-14 Thread Uri Guttman
On 05/14/2016 08:20 PM, lee wrote: Uri Guttman <u...@stemsystems.com> writes: On 05/14/2016 07:11 PM, chace wrote: Can you miss something you weren't aiming at? Thanks for the fun fact, Uri :) well, he asked about other langs with map like features which was the target you aimed

Re: This is one of the things ...

2016-05-14 Thread Uri Guttman
On 05/14/2016 07:11 PM, chace wrote: Can you miss something you weren't aiming at? Thanks for the fun fact, Uri :) well, he asked about other langs with map like features which was the target you aimed at. so missing lisp is worth noting! :) uri -- To unsubscribe, e-mail:

Re: This is one of the things ...

2016-05-14 Thread Uri Guttman
On 05/14/2016 06:58 PM, Aaron Wells wrote: Ha. Java has one... but it's not very pretty. Just like anything Java, it's bloated, overly verbose, and clunky. Java just discovered "lambdas" a couple years ago with jdk 8. But functional languages have had lambda syntax for years. Ocaml:

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

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

Re: This is one of the things ...

2016-05-12 Thread Uri Guttman
On 05/12/2016 11:00 PM, SSC_perl wrote: On May 12, 2016, at 7:10 PM, Shawn H Corey wrote: my $holders = join ',', ('?') x @cgi_params; PBP recommends that you put short strings that are all punctuation in q{}, so they will be easier to read. my $holders = join q{,}, (q{?}) x @cgi_params;

Re: This is one of the things ...

2016-05-12 Thread Uri Guttman
On 05/12/2016 08:04 PM, lee wrote: ... I appreciate perl for: $dbh->do("INSERT INTO $T_ENTRIES (" . join(', ', map($dbh->quote_identifier($_), $cgi->param)) . ') VALUES (' . join(', ', map($dbh->quote($_), map($cgi->param($_), $cgi->param))) . ')') if(scalar($cgi->param)

Re: perlapi overrides system read()/ioctl() methods

2016-05-12 Thread Uri Guttman
On 05/12/2016 04:15 PM, Timothy Madden wrote: Hello I am trying to write an extension module (uses native C code) and I notice after including , that POSIX read() function is now overriden by a Perl macro. Can I find this explained somewhere please ? Is it safe to ignore ? Should I #undef

Re: Where is PERL5LIB documented?

2016-05-05 Thread Uri Guttman
On 05/05/2016 11:42 PM, Peng Yu wrote: Hi, I am trying to find the official doc of environment variable PERL5LIB. But I don't find it on perldoc.perl.org. Does anybody know where I can find the official doc of PERL5LIB? perlrun covers it in the environment section. i did search for it on

Re: Are there (non-obvious) differences in string quoting methods?

2016-04-06 Thread Uri Guttman
On 04/07/2016 12:28 AM, Kent Fredric wrote: On 7 April 2016 at 07:20, Jonathon Fernyhough wrote: qq{} obviously wins when there would otherwise be a lot of escaping, but are there any downsides of using this method more generally (other than double-quotes being two

Re: Are there (non-obvious) differences in string quoting methods?

2016-04-06 Thread Uri Guttman
On 04/06/2016 03:20 PM, Jonathon Fernyhough wrote: Hi, I'm working my way through Learning Perl (6th) and Modern Perl (4th) and was wondering whether there are any (non-obvious) drawbacks to the different string quoting methods. First up, double-quoted strings. The "usual method" of

Re: carp and cgi warnings

2016-02-13 Thread Uri Guttman
On 02/14/2016 01:09 AM, Uri Guttman wrote: On 02/13/2016 02:07 PM, lee wrote: Brock Wilcox <awwa...@thelackthereof.org> writes: Greetings! Could you give an example of these warnings, and even better some minimal code that generates them? Something like this gives you warnings in a

Re: carp and cgi warnings

2016-02-13 Thread Uri Guttman
On 02/13/2016 02:07 PM, lee wrote: Brock Wilcox writes: Greetings! Could you give an example of these warnings, and even better some minimal code that generates them? Something like this gives you warnings in apaches error.log: #!/usr/bin/perl # use strict; use

Re: Counter Help

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

Re: Is perl user specific

2016-01-06 Thread Uri Guttman
On 01/07/2016 12:29 AM, Ankita Rath wrote: Hi all, I checked the mentioned things. Perl -v Which perl Echo $PATH Everything is same for both the user. I am not understanding why is it working in one user and not in other. is there a #!/usr/bin/perl (or similar) in beginning of the

Re: Is perl user specific

2016-01-06 Thread Uri Guttman
On 01/07/2016 12:53 AM, Ankita Rath wrote: Yes #!/usr/bin/perl is there in the code. We both are using same code. yes, but which versions of perl does that path point to on your systems? run this on each system: /usr/bin/perl -v my guess given what we have seen is that the default perl

Re: Is perl user specific

2016-01-06 Thread Uri Guttman
On 01/07/2016 02:38 AM, Duncan Ferguson wrote: If the perl binary is the same between both users, but you are getting module version errors, then it is possible you have other environment settings telling perl to use different library paths To check, use env | grep –i perl and look for

Re: Is perl user specific

2016-01-06 Thread Uri Guttman
On 01/07/2016 01:11 AM, Ankita Rath wrote: /usr/bin/perl -v is 5.8.8 on which system? you need to print that for both. one of them is using 5.8.8 and the other is using an older perl which doesn't work for your code. uri -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For

Re: access hash in specific sequence

2015-09-03 Thread Uri Guttman
On 09/03/2015 04:50 PM, Marius Gavrilescu wrote: gary.stainb...@ringways.co.uk (Gary Stainburn) writes: On Thursday 03 September 2015 18:19:57 Marius Gavrilescu wrote: The above can be shortened using the Sort::Key module. use Sort::Key 'nkeysort'; for my $key (nkeysort {

Re: converting Genbank format in gff format

2015-08-18 Thread Uri Guttman
On 08/17/2015 11:03 PM, John SJ Anderson wrote: On Mon, Aug 17, 2015 at 3:58 PM, Uri Guttman u...@stemsystems.com 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

Re: converting Genbank format in gff format

2015-08-17 Thread Uri Guttman
On 08/17/2015 03:57 AM, 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. the answer is yes, perl can convert anything into anything. that is true for most if not all languages. do

Re: reading from socket

2015-08-12 Thread Uri Guttman
On 08/12/2015 01:53 PM, Brandon McCaig wrote: Keep in mind that when reading from a socket you're not reading directly from a hard link to the data. There's an entire network of devices that the data has to travel through to arrive at your machine. Lots can happen on the network. Packets can

Re: Yenc encoder performance

2015-07-31 Thread Uri Guttman
On 07/31/2015 07:39 AM, David Emanuel da Costa Santiago wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hello. Thanks for your reply. I remember that i did some performance tests and $string = $string .something had better performance than $string .= something which matched the

Re: Yenc encoder performance

2015-07-30 Thread Uri Guttman
On 07/30/2015 04:14 PM, David Emanuel da Costa Santiago wrote: my @YENC_CHAR_MAP = map{($_+42)%256;} (0..0x); my $YENC_NNTP_LINESIZE=128; sub _yenc_encode{ my ($string) = @_; my $column = 0; my $content = ''; my @hexString = unpack('W*',$string); #Converts binary string to hex

Re: Perl hash

2015-07-30 Thread Uri Guttman
On 07/30/2015 11:38 PM, bikram behera wrote: Hi Team, hi, we aren't a team. this is a public mailing list. Please send me hash uses and concept think of them as arrays but instead of integers for indexing, you use strings. the uses are too many to list here. some are data structures,

Re: AW: Traversing directory recursively

2015-07-10 Thread Uri Guttman
On 07/10/2015 04:50 AM, Nagy Tamas (TVI-GmbH) wrote: Hi, That works fine, thx: sub Traverse { find({wanted = sub { if(-d $File::Find::name) { $writer-startTag(Folder, Name = $File::Find::name); } }, postprocess =

Re: Traversing directory recursively

2015-07-09 Thread Uri Guttman
On 07/09/2015 01:19 PM, Jim Gibson wrote: It is because you are calling the Traverse() subroutine with two arguments to recurse a directory tree, but you are not using the arguments. Each call to Traverse uses the global $dir variable as the root of the tree, so it will never terminate. You

Re: Debugging and passing constant value at run time

2015-07-07 Thread Uri Guttman
On 07/07/2015 10:52 AM, Ron Bergin wrote: Which means that neither approach is perfect. I still prefer the variable over the constant. I have never done any benchmark tests to see if there is any significant performance difference. Have you? if you have a lot of debugging code, it can make

  1   2   3   4   5   6   7   8   9   10   >