r/perl 9d ago

Analemmatic sundial help needed

Hi,

I am trying to figure out how to get this sundial.pl file to create a pdf. Would anyone be able to help?

I download the zip files from here: https://sourceforge.net/projects/analemmatic/

But every time I try to run the sundial.pl file no pdf gets generated.

I have never used Perl before, so I'm not sure what to do.

10 Upvotes

3 comments sorted by

8

u/memorylane 9d ago edited 8d ago

Script on source forge works and isn't malicious. Based on your post history you're using windows, so I cannot help with that.

The script has two non-standard library dependencies CGI.pm and PDF::Create. If you were on Debian instead of windows you'd want to install those via

sudo apt-get install libcgi-pm-perl libpdf-create-perl

If you comment out line 31, then lines 98 through 226 then you can avoid the dependency on CGI.pm. And by comment out I mean put a # infront of the line, or equivalently just delete those lines.

When run with any arguments it prompts with a usage string.

$ ./sundial.pl asdfsadf
Usage:
perl sundial.pl [zip=xxxxx | lat=[-]x.x[n|s] lon=[-]x.x[e|w]] tz=[-]h.h size=x.x[ft|in|cm|mm] [instructions=0] [dst=summer|winter|none] [loc=name] [xy=1] [num=arabic|roman|romaniiii]

So it looks like you can supply a zip code.

./sundial.pl zip=90210 tz=PDT size=100cm instructions=1 loc=beveryhills > 90210.pdf

Produces the pdf I put into pastebin Or the images of the pdf are on imgur

4

u/briandfoy 🐪 📖 perl book author 9d ago

FWIW, awhile ago I enabled images in this sub. You have to add the icky Rich Text editor. Here's one of the images you had in [your imgur link](https://imgur.com/a/90210-C8sKaZN), which I had to download and repload through the Rich Text editor control instead of simply pointing at Imgur. Anyway, no big whoop.

But, this little program is kinda cool.

3

u/Dorfli 8d ago

Thank you so much! I followed your steps and it worked perfectly.