FVWM: Modules, Perl, and Perl Modules

From: Nick Fortune <fvwm_at_nymar.demon.co.uk>
Date: Mon, 9 May 2005 10:52:08 +0100

Greetings, All.

I'd like to ask the advice of this list's readers. I'm writing a module in
Perl. More to the point, I'm writing a HowTo about writing modules in Perl,
and I'd like my doc to reflect something approaching best practice.

The thing is that the code is approaching that level of complexity when I
would usually split a perl script into modules. Just to be clear, that's
perl modules as in files ending in '.pm. and included using the "use"
pragma, as opposed to scripts executed by FVWM that just happen to be
written in Perl.

So the question is, where would be the best place to keep these? If they were
part of the distribution, they could find a home in the directory pointed at by 'fvwm-perllib dir'. But they're not.

I don't mind explaining about PERL5LIB and how to set up local lib directory,
I was just wondering what would satisfy the principle of least surprise for
long time FVWM users.

I'm tending towards saying "create a directory $FVWM_USERDIR/perl and put the .pm files in there" and then pointing the script at the modules with a "use lib" directive. The trouble is that's fragile. If I hardcode the location and they can't use it, or don't want to use it, then the module breaks.

So I'm back to explaining about PERL5LIB which seems a bit of an overhead for a module that should just load and go. I suppose I could jam all the packages into one file. Bad perl practice there, but it'd solve the problem.

So: any thoughts or ideas? Anyone solved this already? Is there an orthodox FVWM way to approach this problem?

Thanks for your time,

Nick Fortune

--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Mon May 09 2005 - 03:52:40 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:57 BST