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

Look ...

I have a daemon with Daemon::Generic.

When run:

linux-2xqo:~ # ./testebackup.pl start Starting teste server

linux-2xqo:~ # ./testebackup.pl stop Killing 14188

Daemon works fine.

But when compile using perlcc, perlcc -B daemon.pl -o daemon and run, dont work more.

linux-2xqo:~ # ./testebackup start Undefined subroutine &main::newdaemon called at testebackup.pl line 11.

linux-2xqo:~ # ./testebackup stop Undefined subroutine &main::newdaemon called at testebackup.pl line 11.

if this script work with perlcc I can continue using perlcc.

Replies are listed 'Best First'.
Re: Daemon::Generic with perlcc
by marto (Cardinal) on Mar 29, 2010 at 20:11 UTC

    See perl compiling not working. If your goal is to create an executable packackage containing your scripts and their prerequisite modules try pp (other packaging tools are available).

      I tried using pp, plus the size of executable files were too big ...

      For example:

      hello.pl

      # !/usr/bin/perl

      print "Hello World";

      File size:

      hello.pl 4.0 k

      hello.par 3.6 M

        As previously stated, there are other methods of packaging code. See the par homepage and the pp docs for hints on how to optimise builds.