Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Using File::Share and PerlApp

by ali0sha (Sexton)
on May 26, 2015 at 12:17 UTC ( #1127811=perlquestion: print w/replies, xml ) Need Help??

ali0sha has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to create an application which uses a manifest.xml. Now in order to access this both while developing and using it, we can use File::Share as recommended in Using File::ShareDir in development, but I also want to be able to access it when it's packaged using PerlApp. Is my only recourse something like this? It seems inelegant, to say the least...

use FindBin '$Bin'; use File::Share 'dist_dir'; my $result; # Get the version bound by PerlApp $result = PerlApp::extract_bound_file("manifest.xml") if defined $PerlApp::VERSION; # Get the distribution's shared files directory $result ||= dist_dir('App-SFDC', 'manifest.xml');

Replies are listed 'Best First'.
Re: Using File::Share and PerlApp (elegance)
by Anonymous Monk on May 26, 2015 at 21:50 UTC

    Is my only recourse something like this? It seems inelegant, to say the least...

    First get something that works, because good enough should be your goal, it works for nature :)

    Also, elegance is easy , just hide the inelegance

    use MyPappyShare qw/ dist_dir /; my $result = dist_dir('App-SFDC', 'manifest.xml');

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1127811]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2020-09-19 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (114 votes). Check out past polls.

    Notices?