Can Someone help a Perl Dummy?

Posted on 2003-02-25
Medium Priority
Last Modified: 2010-03-05
You'll have to excue my total ignorance when it comes to Perl, I know nothing.

I have a perl script that one of our remote programmers developed, unfortunately he is so unbelievably wrapped up in projects that he can't devote all of his time to my site.

Anyway, this script is supposed to take text files and parse them out into an XML template.  When I run the script it simply moves the file to the destination folder and makes no changes to it.

Looking at the code, I see that there are two modules that I don't think I have.  One is HTML::Entities and the other is Time::Local.  I found some info on them at perldoc.com but it was kinda greek to me.

I'm using ActivePerl 5.80 and I can't seem to find those modules when I do a search in ppm.

Can someone explain to me what those modules do and where I can actually find them?
Question by:icarus004
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 11

Expert Comment

ID: 8018796
From the server's command line (as root) issue:

perl -MCPAN -e 'install HTML::Entities'


perl -MCPAN -e 'install Time::Local'


~Kelly W. Black

Accepted Solution

mikezone earned 200 total points
ID: 8022154
You're absolutely right when you say that the perldoc for HTML::Entities looks like another language. Because that's what it's for; it helps translate HTML Entities (one of the W3C's solutions for localization) into Unicode so that your PC might have a chance to render it. This includes things like characters with umlauts, accents and more.

Time::Local is a play on the Perl built-in function, localtime(), which takes the number of seconds since the epoch (Jan 1, 1970) and returns the local time in the traditional time_t format, which is to say an array that has: seconds, minutes, hours, date, month, year, and a boolean for if that year a was a leap year.

Time::Local has one particularly useful function, timelocal(), which takes an array in time_t format (you can lie about the part about the leap year; if you don't know, it won't hurt you) and returns the number of seconds since the epoch. This is useful if you want to compare dates and timestamps and you don't [know that you] want to use Date::Calc or Date::Manip.


Once you've downloaded the zip files and unzipped the contents, you'll see (among other things) a *.ppd file. Open up a DOS prompt and go to where the *.ppd file is and type:

  ppm install *.ppd

where the * is the actual name of the module you want installed. You can also learn how to use ppm to download and install the modules remotely, however, I find that the approach I advocate has two advantages: If my firewall gets goofy, I can always count on http to be able to get the zip files (I think ppm uses ftp, but I could be wrong, in any case, it's one less thing to configure), and once I've downloaded the zip file, I now possess the source and know that my software will always work if I keep using the version that I have.

Hope this helps,

- m.

Author Comment

ID: 8026436
Definitely very helpful.  Thanks for putting it in plain english.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question