Maybe you should have a configuration file in user's home dir pointing to all your resources, read-only, like icons but also re-writable like the SQLlite file! This solves also the problem of when you want to preserve the contents of the database for the next run. An installer of some sort (can just be a shell script) will also allow you taking care of different users.

Alternatively, create a shell script which will call your perl pp file from within a certain folder which you will know that program resources (ro/rw) are located. You achieve this via a "cd" (change dir) first. Call that script instead of the pp executable from anywhere you like, it will first cd to proper dir. Firefox for example does this: 1) install resources to user dir, 2) install firefox binary and libs in system bindir, 3) create a shell script (mine is /usr/bin/firefox) which finds resources, checks things and then it calls the real firefox binary. However, that "cd" I do not like.

p.s. for joining filenames and paths in different OS, I use the portable File::Spec->catfile.

p.s. 2 in windows I often found that two bugs combined together could result in correct program flow!


In reply to Re^7: pp macOS external file by bliako
in thread pp macOS external file by IB2017

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.