perl-module

In Perl, XML::Simple is not able to dereference multi dimensional associative array parsed by Data::Dumper

无人久伴 提交于 2019-12-25 04:29:25
问题 Following is the xml file that I want to parse: <?xml version="1.0" encoding="UTF-8"?> <topic id="yerus5" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"> <title/> <shortdesc/> <body> <p><b>CCU_CNT_ADDR: (Address=0x004 Reset=32'h1)</b><table id="table_r5b_1xj_ts"> <tgroup cols="4"> <colspec colnum="1" colname="col1"/> <colspec colnum="2" colname="col2"/> <colspec colnum="3" colname="col3"/> <colspec colnum="4" colname="col4"/> <tbody> <row> <entry>Field</entry> <entry>OFFSET<

How Can I Install Redis perl library Manually i.e offline.And From Where Can I Get All The Dependencies To Install

末鹿安然 提交于 2019-12-24 20:10:02
问题 I am trying to install check_redis plugin and for that i need redis perl library but i don't have access to CPAN and internet.So Is there any way to install by downloading zip file and all the dependencies.I am using nagios core.Here is the plugin i am trying to install 回答1: Because I had a similar problem at work I happened to write my personal Q&A on this topic. Here it is: Q: How to install CPAN modules without Internet access? A: 1. Install CPAN::Mini on the internet machine: $ cpan CPAN:

How to Print Spelled out month names rather than numbers

青春壹個敷衍的年華 提交于 2019-12-24 17:57:38
问题 How can you get Perl to print names of months rather than their numbers for example: 9 should appear as September. I would like the program below to print names of months rather than their numbers. #!/usr/bin/perl use strict; use warnings; use Date::Easter; print "Please enter a year"; chomp (my $year = <STDIN>); my ($m1, $d1) = easter ($year); my ($m2, $d2) = julian_easter ($year); my ($m3, $d3) = orthodox_easter ($year); print "Gregorian => Month: $m1 Day: $d1\n"; print "Julian => Month:

XML::Compile does not find the root element I give it

走远了吗. 提交于 2019-12-24 16:26:58
问题 Goal: generate the Perl data structure needed to populate and write XML output, using an existing XSD schema. What I've done: I've installed XML::Compile, found a tutorial on how to use it, and read through a modified example here. I've processed my XSD file using CAM Template Editor to ensure CAM can generate an example XML file from the template, which it can, and I've compared the XML output to the XSD to ensure the two relate the way I think they should. They do. Next, I've simply pointed

Installing Term::TermKey returns error

走远了吗. 提交于 2019-12-24 10:00:33
问题 I have a problem while installing Term::TermKey with CPAN and I can't find information about how to solve it. Here is an output: cpan[9]> install Term::TermKey Running install for module 'Term::TermKey' Running Build for P/PE/PEVANS/Term-TermKey-0.10.tar.gz Checksum was ok '/usr/bin/perl Build.PL installdirs=site' returned status 256, won't make Running Build test Make had some problems, won't test Running Build install Make had some problems, won't install May someone help me? //edit I

What's wrong with this Perl module?

谁都会走 提交于 2019-12-24 08:47:58
问题 I am making a very, very simple module (it is the first I've ever wrote): package Master::Math; use 5.12.4; use strict; use warnings; require Exporter; our @ISA = qw(Exporter) our %EXPORT_TAGS = ( 'all' => [ qw( max =cut 1; # End of Master::Math When I run use this in my program, I get the error Invalid version format (non-numeric data) at C:/Perl/lib/Master/Math.pm line 3, near "package Master::Math " syntax error at C:/Perl/lib/Master/Math.pm line 3, near "package Master::Math require

Net::LDAPS throws unknown error during SSL connect

自闭症网瘾萝莉.ら 提交于 2019-12-24 06:47:11
问题 I am trying to connect to an LDAP server using the Net::LDAPS module. I am passing the right username, password and capath to it. The same code with all the modules in the same version works on one of my other machines. But on this particular machine I see this error. The sample code I am working with : my $ad_host = 'XYZ'; my $ad_port = 636; my $ad_user = 'ABC'; my $ad_pass = '****'; my $ca_path = '<path to ca cert>'; my $ldap = Net::LDAPS->new( $ad_host, port => $ad_port, verify => 'require

Tie file not working for loops

最后都变了- 提交于 2019-12-24 05:55:24
问题 I have a script which pulls all the pm files in my directory and look for certain pattern and change them to desired value, i tried Tie::File but it's not looking to content of the file use File::Find; use Data::Dumper qw(Dumper); use Tie::File; my @content; find( \&wanted, '/home/idiotonperl/project/'); sub wanted { push @content, $File::Find::name; return; } my @content1 = grep{$_ =~ /.*.pm/} @content; @content = @content1; for my $absolute_path (@content) { my @array=''; print $absolute

How to dynamically load modules and execute methods in perl

流过昼夜 提交于 2019-12-24 00:56:59
问题 I'm following up on this question about perl web services. I've managed to get modules loading and executing from a main program. Each of the modules is something like this: #!/usr/bin/perl package NiMbox::perlet::skeleton; use strict; use warnings; require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw(%DEFINITION main secondary); our %DEFINITION; $DEFINITION{'main'} = { summary => 'skeleton main', description => 'long skeleton main description', args => { 'box' => {}, 'other' => {}

Custom perl installation cannot find Git.pm

核能气质少年 提交于 2019-12-23 15:39:30
问题 I have installed my own copy of Perl in my home directory, but I have some Perl scripts that require Git.pm, which is part of the Git distribution and not installable from CPAN. The Git.pm used by the system perl resides at /usr/share/perl5/Git.pm . How can I make this Git.pm available to a custom perl install, or get another copy of Git.pm installed in the correct location? Should I just copy it into my own Perl's lib directory? 回答1: Git.pm is self-contained, so copying it in a directory