RE: Perl version

2023-06-24 Thread Duncan Ferguson
Use the publicly available docs which shows this, as at https://perldoc.perl.org/perldelta and just go back through each version you are interested in. These docs should also be also available on your local machine – use “perldoc perldelta” for your installed version, or ”perldoc perl5280delta”

RE: proper use of TEMPLATE

2019-03-15 Thread Duncan Ferguson
Rick, Can you include the actual code you are referring to as from your message I do not yet understand what the issue is Duncs -Original Message- From: Rick T [mailto:p...@reason.net] Sent: 14 March 2019 17:15 To: Perl Beginners Subject: proper use of TEMPLATE I’m sure this is a “

RE: How to compare timestamp in two different files

2018-10-22 Thread Duncan Ferguson
In the past I have used the DateTime module to good effect for this. There are a number of additional modules you can use that parse the string for you that match specific types of string format (such as ISO8601) or your own timestamp definition. https://github.com/houseabsolute/DateTime.pm/wi

RE: regex to get the rpm name version

2018-07-27 Thread Duncan Ferguson
I would suggest you change your approach and user the query mode of RPM to get your information instead of build up a regexp: rpm -qa --queryformat "%{NAME}\n" Duncs From: Asad [mailto:asad.hasan2...@gmail.com] Sent: 27 July 2018 13:55 To: beginners@perl.org Subject: regex to get the rpm name

RE: CPAN will shutdown

2018-05-23 Thread Duncan Ferguson
Just to clear things up – CPAN is NOT shutting down! The website http://search.cpan.org/ is being *replaced* by http://search.mcpan.org/ - the rest of the cpan subdomains (such as pause.cpan.org) are not being touched. Read https://log.perl.org/2018/05/goodbye-search-dot-cpan-dot-org.html for

RE: is there a way to shorten these lines?

2017-11-27 Thread Duncan Ferguson
Are you after "dirname", past of File::Basename? http://perldoc.perl.org/File/Basename.html $ perl -MFile::Basename -le 'print dirname(shift)' /path/to/some/directory/somewhere /path/to/some/directory Duncs -Original Message- From: fluca1...@gmail.com [mailto:fluca1...@gmail.com] O

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

2017-08-04 Thread Duncan Ferguson
You may also find the following docs useful http://modernperlbooks.com/books/modern_perl_2016/03-perl-language.html#UGFja2FnZXM http://modernperlbooks.com/books/modern_perl_2016/07-object-oriented-perl.html#T2JqZWN0cw (see Moose and Blessed References) The index of the book is at http://modernp

RE: how to repeatedly execute a command on a remote machine via a shh login from within a perl program capturing the output?

2017-04-19 Thread Duncan Ferguson
If the temperature is available on your switch, can you not enable SNMP on it and read the specific OID to get the info? Far far easier than trying to keep an ssh connection open, I think. I guess this does depend on the switch type and whether the info is available on the device via SNMP, tho

RE: Processing binary data

2016-03-31 Thread Duncan Ferguson
Lars, I believe 'unpack' is the right way to go, you just need to get the template right ('N' in your example) See the explanation on http://www.perlmonks.org/?node_id=224666, especially the section on 'unpack' "unpack takes a template string and a scalar and returns a list of values." ($

RE: Counter Help

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

RE: Is perl user specific

2016-01-07 Thread Duncan Ferguson
environment settings that will override @INC. Ankita can also compare the more detailed output from “perl -V” which will include the library paths (@INC) to prove/disprove this. Duncs From: Uri Guttman [mailto:u...@stemsystems.com] Sent: 07 January 2016 07:45 To: Duncan Ferguson ; Ankita Rath

RE: Is perl user specific

2016-01-06 Thread Duncan Ferguson
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 differences, especially for PERL5LIB or PERLLIB Dun

RE: Is perl user specific

2016-01-06 Thread Duncan Ferguson
This suggests to me you have two version of perl on your system and your users are using different versions Check by running these commands as each user and seeing what they return # show the perl version being used perl –v # show where perl is being used from which perl Duncs From: Ankita R