Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Using File::Share and PerlApp

by ali0sha (Sexton)
on May 26, 2015 at 12:17 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found