Questions tagged [perl-module]

A Perl module is a reusable portion of Perl code.

In Perl, modules are vital to object-oriented design and can provide static variables referenced similarly to those in C++. The package model improves code organization, by allowing the coder to import functions from external files and 'bless' new object instances. Further, perl allows the directory structure holding modules to aid in the description of an object hierarchy. Perl module files traditionally have the extension '.pm'

see perlmod - perldoc.perl.org for more information.

1358 questions
-2
votes
1 answer

How to stop array sort in Perl

I knew this is a very basic question in Perl so i could not find solution for this anywhere. I am using Perl package Text::ASCIITable to beautify the output. Below is my code, where i am constructing table row using array. my @output = [ { …
Raja
  • 3,477
  • 12
  • 47
  • 89
-2
votes
2 answers

How to delete multiple lines between patterns in a file in Perl

Question >> I need to delete lines which are mentioned "line to be deleted" between the "pattern1/2/3 {" and "}", using Perl! Thanks Line 1 of code to keep Line 2 of code to keep } pattern1 { line to be deleted line to be deleted } pattern2…
Ravi Raj
  • 53
  • 1
-2
votes
1 answer

json parsing using perl

I have a huge json file ~1000+ lines. I wanted to implement two things. 1) In the json file,if "Id" : "232799" then assign "s" as "1861" I did this using decode_json. It works as expected. 2)Increment the version number by 1 and save the file in…
virat
  • 3
  • 1
  • 2
-2
votes
1 answer

How to do an if statement in perl?

Having a problem with if statement in Perl, my if statement is not working. What am I doing wrong, because I'm using strict and warnings module, but still my if statement is not working. #!/usr/bin/env perl use strict; use warnings; sub…
-2
votes
1 answer

perl nested regex

Text record: (1,2,3,4,{fred,don,max,rat,grp},45,67,mat,jhon,{a,b,1,2,sd[{1,2},{4,5}],45,67,P[{34,56,34},{uni,cast,r}],c{q,ew,3,4},1,2,3,cf{2,4,5,8},6},4,fr{24,45,67},5,NOL) Desired…
yuvi
  • 21
  • 3
-2
votes
4 answers

Perl script to read a directory and having file name started by a particular name

I have a directory containing thousand of file. Suppose I have 3 pdf files having same name like: sample_Q1.pdf sample_Q2.pdf sample_Q3.pdf Now I want to find the file list having particular name started with "Sample". I'm currently…
-2
votes
1 answer

How do i search and extract commented lines from a file using perl?

I am new to Perl programming. Need your help in searching and extracting only commented lines from a file. Below is an example { This is line 1 /*This is line 2 This is line 3 This is line 4*/ This is line 5 } I just want to…
sravan
  • 1
  • 2
-2
votes
1 answer

Array of hashes manipulation

I'm running the script below to query a monitoring system and the results I get back are in array of hashes. What is the best way to access the individual hashes and their elements? use strict; use warnings; use YMS::Client::MonStatus; use…
Ani
  • 109
  • 2
  • 12
-2
votes
1 answer

how to update each line in a file

i have file in that i have one line is like {,} ,user will give the value N for example N=9 ;then these lines should print 9 times in the file with increment of N value . Example: input file contains one line like this…
Sri
  • 33
  • 1
  • 8
-2
votes
1 answer

How to remove the decimal part of columns data in table using PDF::Table perl module

I want the data in tables without decimal values. I searched the options for doing the same in PDF::Table and PDF::API2 perl modules since i'm making use of these modules in my code. But i did not find any options. Please help me with this issue.
-2
votes
1 answer

Global symbol "$i" requires explicit package name

I have 3 arrays and then I open a txt file which contains firstname , lastname and email(alone with some html codes like shown below) Mike stone mike@rt.com I first count the lines in the file, then I parse…
mac
  • 863
  • 3
  • 21
  • 42
-2
votes
1 answer

Is Statistics::Descriptive similar to using Statistics::R module( in a PERL Script)?

I think Statistics::Descriptive does not call R language module, whereas the Statistics::R does. Am I right?
-2
votes
3 answers

Sort Multiple line according to fields

I have a record here with multiple lines, what I what to do is sort them according to type and the 6digits number in the line HEADER1. Here is the record: HEADER1|TYPE1|123456|JOHN…
Soncire
  • 309
  • 1
  • 5
  • 15
-2
votes
4 answers

Extracting specific multiple line of records that is pipe delimited in perl

I have a file that looks…
Soncire
  • 309
  • 1
  • 5
  • 15
-2
votes
1 answer

Perl module, inhereting from DBI , "Can't call method 'prepare'" error

Possible Duplicate: Perl + POO and “Can't call method ”prepare" I learned poo and i got to play with perl, create this module but when I call the segudno method I skip the following error 'Use of uninitialized value $database in concatenation (…
opmeitle
  • 195
  • 6
  • 19