develooper Front page | perl.wxperl.users | Postings from July 2008

Re: including non-perl resource files?

Thread Previous
From:
Gabor Szabo
Date:
July 31, 2008 11:12
Subject:
Re: including non-perl resource files?
Message ID:
d8a74af10807311112tcd7b940kc0cf76b03cb7b618@mail.gmail.com
On Thu, Jul 31, 2008 at 1:18 AM, Johan Vromans <jvromans@squirrel.nl> wrote:
> "Gabor Szabo" <szabgab@gmail.com> writes:
>
>> I have arived to the point in Padre that I started to add a toolbar
>> to the main frame. Base on the example in the Demo I use the
>> external .xpm files. All works well in my development environment as
>> I know where the files are relative to the executable.
>
>> I wonder how should I include these files in the CPAN distribution,
>
> Ah! Welcome to the wonderful world of software distribution...
>
> Unfortunately, there are no widely accepted standards to solve this.
> Fortunately, there is more than one way to do it. For example:
>
>  - put the data in a .pm, and load it.
>  - put the data in a subdirectory below your modules, and use @INC to
>    find it.
>  - File::HomeDir and File::ShareDir are good alternatives, although
>    they are not widely supported yet.
>
> I use the 2nd approach in one of my major Perl apps, EekBoek.
>
> When installing via a package manager, I usually put the files in the
> location according to the system conventions. E.g., on Fedora, all
> modules and files will be placed in /usr/share/MyPackage instead of
> clobbering /usr/lib/perl5.

In App::Wack I do the first but I don't think that's a good solution.

On the recommendation of AdamK as well, I went with File::ShareDir 1.00
in Padre 0.03_01.

We'll see how it works out and then we should get some changes in the
core so from later versions of perl there will be some standard solution.

>
> HTH,
>        Johan
>
> PS: Congrats with your Camel Award!

thanks

   Gabor

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About