• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

Can Someone help a Perl Dummy?

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?
0
icarus004
Asked:
icarus004
1 Solution
 
kblack05Commented:
From the server's command line (as root) issue:

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

and

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

Regards,

~Kelly W. Black
0
 
mikezoneCommented:
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.

  http://ppm.activestate.com/PPMPackages/zips/6xx-builds-only/

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.
0
 
icarus004Author Commented:
Definitely very helpful.  Thanks for putting it in plain english.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now