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
-4
votes
1 answer

How do I sort a list of IP addresses and compute a class and netmask for each?

I have 2 options. One is that I have a array that has a list of IPs. For example my @Ip=(); # array that has the IPs below in it Sample input: 108.0.0.30 108.0.0.30 108.0.0.30 192.168.1.1 192.168.1.2 10.0.0.1 I need a program that can sort such…
smart boy
  • 671
  • 4
  • 11
  • 24
-4
votes
1 answer

how to handle when use module

I have one module, such as A.pm, in this A.pm, it will read and write one certain conf file, such A.conf. Now in my perl script file: 1_perl.pl, I use A.pm to reset certain value in A.conf file and also use A.pm to write this value in 2_perl.pl. So…
-4
votes
2 answers

Perl script to read a csv file from a particular row to end of file

I have a CSV file my.csv with this content: abc,yyy efg,zzz zsc,vvv uvw,ggg Depending upon the value in variable $X I need to read from that particular value until the end of the file. For example: If $X = efg, the output would be: …
user1592147
  • 11
  • 3
  • 8
-4
votes
1 answer

how to get block of xml code through perl

From morning i was scratching my head to resolve the below requirment. I know how to parse an xml but not able to find out the sollution to get the exact block along with tags. sample code:
user1575765
  • 60
  • 3
  • 10
-5
votes
2 answers

Not able to open a file to read since file name starts with 'r'

My file's name is "rootpass" and I am trying to read it like this, my $rootpass; my $passfile = "$jobDir/\rootpass"; print "file name = $passfile\n"; if( -e $passfile) { open ROOTPASS, '$passfile'; $rootpass = ; print…
quickdraw
  • 247
  • 1
  • 2
  • 12
-5
votes
1 answer

Compare files, then enter coordinates into perl script then run perl script with pre-written commands and coordinates

I would like a batch that reads a file called ships.txt, then takes the entries (each on a line) from that file and compares them to a file with the file extension of *.map (say test.map), looking for the match, which will always be at the end of a…
Jason
  • 1
  • 1
-5
votes
2 answers

how to import multiple packages in perl script?

Possible Duplicate: how to import multiple custom modules in our own perl script? I have some packages. i want to import them all at once. Right now, i am doing like use lib 'path to packages'; use package1; use package2; ...... use…
-6
votes
1 answer

how to print the range of sequence number

Hi friends i have a list of non sequential numbers in a file, need to list sequential range of number. example: 641 642 643 712 713 714 813 814 815 need to print: 641-643,712-714,813-815 either in awk,unix or perl
Mahesh Cholleti
  • 19
  • 1
  • 10
1 2 3
90
91