Thanks. Looking at findINC it'll search @INC for a file. If icon.png is in the same directory as example.pl, example.pl fails to execute with the same error. I'm not a Tk expert, there are many nodes here from people with much more experience (Super Search, DuckDuckGo etc..)

However, you're specifically adding this file to resources/icon.png, either altering your code to Tk::findINC('resources/icon.png') and packaging the way you did will work, e.g.

The fils is located here: /tmp/par-6d6172746f/cache-535ec6de1b4efb148a +c99123aadeb8c4f902fa64/inc/resources/icon.png

Or just don't package that way:

marto@Shemp:~/tkpp$ ls icon.png tk.pl marto@Shemp:~/tkpp$ pp -a "icon.png;icon.png" -o tk tk.pl marto@Shemp:~/tkpp$ ./tk The fils is located here: /tmp/par-6d6172746f/cache-df7f1b303bbe076aaf +1a97c9630e6d50e56371c6/inc/icon.png

I've posted an example in the past showing how to determine if the code is being run via a script of a PAR packaged executable, let me know if you can't find this, should you go looking.

Lastly, I don't know what you want to do with the png file, perhaps there's a better more portable way to achieve that.


In reply to Re^3: Using Tk inside a Perl exe by marto
in thread Using Tk inside a Perl exe by Garden Dwarf

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.