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

Hi Monks,

I am using pp util to create binary in Linux by issuing pp -B -p -o ex ex.pl

#data to write my $data =[ ["Name ", "$name ", ], ["Age", "$name ", ], ]; # table creation $pdftable->table( $pdf, $page, $data, x => 150, w => 500, start_y => 400, next_y => 750, start_h => 700, next_h => 720, font => $pdf->corefont('Helvetica'), font_size => 11, padding => 5, # cell padding padding_top => 5, # top cell padding, overides padding padding_right => 5, # right cell padding, overides padding padding_left => 5, # left cell padding, overides padding padding_bottom => 5, # bottom padding, overides -padding border => 1, cell_props => $cell_props, # see section CELL PROPERTIES column_props => $col_props, ); ...
...

In my code I use PDF::API2 and PDF::Table modules which will write data in PDF.

Running ‘perl ex.pl’ I can get the desired output in PDF file

After packaging using pp util if I run ‘./ex’ only Name and Age is displayed and no value for $name, $age is displyed on PDF in the table

Can any help body help me out

Thanks Madhi

Replies are listed 'Best First'.
Re: perl pp packging problem
by lamprecht (Friar) on Jul 24, 2009 at 18:32 UTC
    Hi,

    pp -B -p -o ex ex.pl

    this should not create a binary but a par archive.

    Cheers, Christoph

      Hi Monk,

      Thanks for your reply.

      Is there any command to run the par achieve created on to a host machine. My requirement is to create a stand alone executable which can run on any Linux machine which doesn’t have any Perl module installed.

      Thanks

      Madhi

        Linux machines without a working Perl installation are rare, especially if you leave out embedded machines. So, most of the times, just delivering your script should work. If you need special modules to be installed, use the CPAN module to install them with an install script. Look at how bugzilla is installed: There is a checksetup.pl script that tests that all required modules are installed.

        On the other hand, Linux runs on a lot of different CPUs (with and without MMU, e.g. x86, x86_64, ARM, MIPS, 68000, powerpc, sparc, sparc64, ...), and with several very different C libraries (glibc2, libc5, uclibc, dietlibc, klibc, ...). So, if you want one executable for all Linux machines, you need to link everything statically (lots of trouble ahead this way) to avoid problems with the different C libraries, and you have to stuff binaries for several platforms into one executable. (I don't know if ELF really supports this.) And even then, this won't work on all Linux machines. While most Linux machines now use ELF as the standard executable format, there are still machines using the a.out format.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)