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

I have this :

script1.pl:

. . . use CGI $q = new CGI; . . . script2.pl: require "script1.pl"; . . . $new_cookie = new CGI::Cookie(-name=>'COOKIE_RSVP',-path=>"/",-value=> +""); print $r->redirect(-uri=>'/index.html', -cookie=>[$new_cookie]); . . .
For to compile, I'm using: "perlcc -r -v -o script2 script2.pl". When I run script2, the result is "Segmentation Fault". I've tried to exclude a "new_cookie = ..." and the script runs "ok"(without the necessary). What is the problem?. Maybe something in the libs???

Detail: To compile "Use Some.pm" not works too.

Help me, please!

Replies are listed 'Best First'.
Re: perlcc problem
by diotalevi (Canon) on Jun 09, 2005 at 20:16 UTC

    You should experiment with the -I parameter to include additional libraries into your build. That is, if you actually use perlcc. You shouldn't use perlcc. Use PAR instead. perlcc doesn't really work - its a toy for use by people who consider such things toys.

Re: perlcc problem
by rlucas (Scribe) on Jun 09, 2005 at 21:45 UTC
    Is CGI::Cookie a module you're using? If so, do you ever "use CGI::Cookie"?

    Realize that there exists CGI::cookie() (the sub in package CGI), but that's not what you're calling. You're calling CGI::Cookie::new() (the constructor for the class, it looks like).

Segfault after compiling with perlcc
by devil (Novice) on Jun 08, 2005 at 19:40 UTC
    Hello guys! I'm trying to compile some scripts with perlcc. The options that I'm using is "-r -v -o". This scripts have "require" to others scripts. The problem is a "Segmentation Fault" message when I run this things after compile. Help me, please!

    Retitled by holli from 'perlcc'.
    20050609 Edit by ysth: reparented under followup question perlcc problem

      perlcc is more of a proof of concept and people don't really use that. Check out PAR instead. That works and works well (enough, mostly).
      Shouldn't you only be getting segmentation faults when your script tries to access memory locations it isn't allowed to? That sounds more like something to do with your code. But then again, i'm only learning this stuff now ;)