Return old files by date

I have the following files in a directory, where the delimiter is "_" and the third field is the date when the file was created. Now I need to always pick the file that has the earliest date in accordance with the first column code. Example: 102

How to read a file that is on the server using the Perl script

I have a file on my perforce client which i can read from the client but i want to read it from the depot instead from my client and i Have to achieve this using a Perl script and my client name is ata and its root directory is /home/ata/hw The follo

Importing variables into the Perl package

I'm writing a basic program whose core logic is split across several project-specific modules for cleanliness (keeping subroutines organised by their purpose in the program's logic). Suddenly had trouble exposing an option from the main package in on

How to name the module Perl, SomeModule vs Some :: Module

Is there any preferred naming convention for perl modules? For example, what is more common practice in perl world - SomeModule or Some::Module? Maybe there are some cases when one style is better than another?If you take a look at CPAN you will see

Overall use of the tool location when using packages

I have a folder tmp which lies in the tool-directory and contains different modules like e.g. myModul.pm: package myModul; print "path in myModul.pm: $dirName\n"; Those are called in the Main, which looks the following: #!/usr/bin/perl use stric

Custom missing module message

I would like to be able to output a custom error message to STDERR if one of my modules cannot be found. From what I understand if I import the module with the use command the lack of the module will be discovered prior to my script being executed wh

How can I fix broken Perl permissions?

I installed a perl module by force install and now perl does not work any longer. Somehow this must have set permissions wrong. perl -V Can't locate Config.pm: Permission denied. BEGIN failed--compilation aborted. How can I fix this? I am on a Mac. I

Perl scans files for multiple channels

I have been learning perl for the past two weeks. I have been writing some perl scripts for my school project. I need to parse a text file for multiple strings. I searched perl forums and got some information.The below function parses a text file for

How to open the command prompt in Administrator mode in Perl

I need to run a command on command prompt as an Administrator. When I usually use the system() command to send a command to run in the command prompt, I do not have Administrator level elevation. How can I obtain Admin level privileges to run my inst

Installing the Perl module under Unix

This is my first time installing a Perl module and I'm having some trouble. I'm trying to install manually In UNIX. These are the steps I am following (Installing DBI module in this case) Download DBI-1.628.tar.gz tar file, Uncompress file with $ tar

Perl convert time zone date without datetime module

I have a date in the format: 05/26/2013 06:08:00 The timezone of above date is GMT -7 how can i change the above to GMT date and time and in format: 26 May 2013 13:08:00 GMT Note: I cannot install any perl module. I know that i can do this easily via

How to use a module in Perl

Guys im really confused on how to use a module i just installed in Perl. I installed a Corelist module in Perl. And i want to display all the modules that came with Perl 5.006. But there is a hint in doing this by using this code which i dont underst

Can not locate image / Info.pm Module error

I'm trying to get the resolution,width,height of the images in the specific file. I have the following code. #use strict; use Image::Info qw(image_info dim); use File::List; #perl2exe_include Image::Info::JPEG; #perl2exe_include PerlIO; my $file = <I

Perl module version

I have a couple of perl modules installed in the $HOME of my web server. The web server used to run perl 5.8.8 so they were installed under $HOME/perl/lib/perl5/5.8.8/... During a server migration, the web hosting company changed perl to 5.10.1 but I

Have a Perl script use one of several secondary scripts

I have a main program mytool.pl to be run from the command line. There are several auxillary scripts special1.pl, special2.pl, etc. which each contain a couple subroutines and a hash, all identically named across scripts. Let's suppose these are name

Perl Inheritance - Who is the Caller of the Parent Class

I have a situation where I need to find the caller of a package and my code looks something like: Inherited.pm: package Inherited; our @ISA = qw(BaseClass); sub new { SUPER::new(); } BaseClass.pm package BaseClass; sub new { $a = caller(0); print $a

Read a spreadsheet from the Excel workbook in Perl

I have a perl script read Excel file and parse using a perl module "Spreadsheet::ParseExcel::Simple; what I want is my script to read only one tab instead of reading all tabs on the spread sheet. here what looks like the portion of the script. # ###

Including files in pm module

I am totally new to Perl/Fastcgi. I have some pm-modules to which will have to add a lot of scripts and over time it will grow and grow. Hence, I need a structure which makes the admin easier. So, I want to create files in some kind of directory stru

Why does $ OSNAME from Perl not work on Solaris?

I remember having used the variable $OSNAME in Linux. Currently I'm working on a project on Solaris where I need to get the OS name and that variable is not working on Solaris. Even a simple one line program does not work: print "OS is $OSNAME\n"

How can I install Crypt :: SSLeay on a Win 64?

I've got 64-bit Vista with ActiveState Perl "v5.10.0 built for MSWin32-x64-multi-thread" and I'm trying to get the Crypt::SSLeay package installed along with versions of libeay32.dll and ssleay32.dll. I've done this before on a Win32 machine usi

Why can not my MacPorts CPAN client find Module :: Build?

I am using the macports in snow leopard. I wanted to install certain perl modules to be able to run a script. The DateTime module to be exact. How do I do this? I tried using the following command. perl -MCPAN -e shell cpan > install DateTime But it

Can I move a Perl installation from one computer to another?

I am trying to set up an application dependant on few Perl modules, but the server I am installing to, does not have Internet connection. I read about offline module installs via ppd files, however I would have to resolve all the dependencies one by

How should I organize many Perl modules?

Consider that I have 100 Perl modules in 12 directories. But, looking into the main Perl script, it looks like 100 use p1 ; use p2 ; etc. What is the to best way to solve this issue?It seems unlikely to me that you're useing all 100 modules directly