Please read the documentation of PerlApp, or at least the docs about bundled functions:
    perlapp --help FUNCTIONS
It will tell you about PerlApp::extract_bound_file(FILENAME) and PerlApp::get_bound_file(FILENAME), which provide access to the bound data:
=head1 FUNCTIONS

The following functions are made available to the Perl program when
running from the executable that I<PerlApp> creates:

=over

=item B<PerlApp::exe()>

Returns the full path (including file name) to the running executable.

=item B<PerlApp::extract_bound_file(FILENAME)>

Writes the content of a bound file to the filesystem.  The file will be
created in a temporary directory and is automatically deleted when the
application terminates.  The function returns the filename of the
temporary file:

    my $datafile = "data.txt";
    my $filename = PerlApp::extract_bound_file($datafile);
    die "$datafile not bound to application\n" unless defined $filename;
    open(my $fh, $filename) or die "Can't open $datafile($filename)\n";

If the file had not been bound, C<extract_bound_file()> returns
C<undef>.

C<extract_bound_file()> always writes files in C<binmode>.  Therefore
files bound with the C<text> option on Windows will be extracted
with C<\n> and not C<\r\n> line endings.

=item B<PerlApp::get_bound_file(FILENAME)>

Returns the content of files included in the executable with the
C<--bind> commandline option.  Returns the whole file as
a single string in scalar context or separate lines in list context,
in which case lines are always split on newline (i.e. $/ is not
considered).

    foreach my $line (PerlApp::get_bound_file("data.txt")) {
        # ... process $line ...
    }

If the file had not been bound, C<get_bound_file()> returns
C<undef> in scalar context or the empty list in list context.

=back

In your sample code you open the file for writing, not reading. That doesn't make much sense because any changes to the file will not be stored back in the application itself. I assume it was just a typo.

Finally, you don't want to use the --tmpdir option unless you absolutely have to. It makes you application dependent on an absolute path value which cannot be changed later.


In reply to Re: Perl App , files and directories by jand
in thread Perl App , files and directories by perl_seeker

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.