in reply to Re^4: Problem in @INC using PAR::Packer on Windows
in thread Problem in @INC using PAR::Packer on Windows

Here you tell us you had used the -a option to add a file, but this example you've given does not show this. Take a look at the -M and -a options, and the related examples in the pp documentation.

If you have any further problems let us know.

Replies are listed 'Best First'.
Re^6: Problem in @INC using PAR::Packer on Windows
by rodrigo.pace.barros (Initiate) on Nov 19, 2009 at 14:30 UTC
    Note: My code can be fount at http://ns2html.sourceforge.net

    The -M switch returns the same error as shown below:

    ===
    D:\documents and settings\r330293\Desktop\ns2html-0.4.6-win32\bin>pp -a subs -o ns2html.exe ns2html.pl
    Set up gcc environment - 3.4.5 (mingw-vista special r3)
    Set up gcc environment - 3.4.5 (mingw-vista special r3)
    Copyright (C) 2004 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


    Set up gcc environment - 3.4.5 (mingw-vista special r3)
    Copyright (C) 2004 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



    D:\documents and settings\r330293\Desktop\ns2html-0.4.6-win32\bin>ns2html.exe
    Can't locate AddrCreator.pm in @INC (@INC contains: subs CODE(0x1304c14) CODE(0x115fb64) CODE(0x115feb4)) at script/ns2html.pl line 29.
    BEGIN failed--compilation aborted at script/ns2html.pl line 29.

    ===

      Aside from the code review advice, using Strawberry Perl 5.10 I was able to download your code and create a working exe with a simple pp -o pp_test.exe ns2html.pl. pp_test.exe works properly.

        The problem persists... :(

        D:\documents and settings\r330293\Desktop\ns2html-0.4.6-win32\bin>C:\s +trawberry\perl\bin\pp.bat -o ns2html.exe ns2html.pl Set up gcc environment - 3.4.5 (mingw-vista special r3) Set up gcc environment - 3.4.5 (mingw-vista special r3) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There i +s NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR +POSE. Set up gcc environment - 3.4.5 (mingw-vista special r3) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There i +s NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR +POSE. D:\documents and settings\r330293\Desktop\ns2html-0.4.6-win32\bin>ns2h +tml.exe Can't locate subs\AddrCreator.pl in @INC (@INC contains: CODE(0x1300e3 +c) CODE(0x115ffac) CODE(0x11602fc)) at script/ns2html.pl line 31.
        Might my machine (Win XP) be with some bug or environment variable that is corrupting my compilation? Thanks! Rodrigo
      First 3 lines leads me to believe you could use a code review
      #!perl push @INC,"/usr/lib/perl5"; #use strict;
      Eeew, you're doing it wrong :D I reccomend
      #!perl use lib '/usr/lib/perl5'; use App::ns2html; App::ns2html->run();
      A re-usability principle your exit button should close MainWindow, not call perl's exit function.

      update: What is this?

      system("> ../tmp/rules.tmp"); system("> ../tmp/routes.tmp"); system("> ../tmp/routes.tmp");
      Please see perlport
        Hi.

        The codes 'system("> ../tmp/<filename>.tmp");' are related to some temporary files my script uses. This only creates empty files.

        I tried to use 'use lib "subs"' on my code, but the problem persists. All my subs are located inside my "subs" directory. And, when I put it on @INC via 'use lib', the problem occurs again:

        ===
        D:\documents and settings\r330293\Desktop\ns2html-0.4.6-win32\bin>ns2h +tml.exe Can't locate subs\AddrCreator.pl in @INC (@INC contains: CODE(0x130067 +4) CODE(0x115f914) CODE(0x115fc64)) at script/ns2html.pl line 31.
        ===

        I´ve not created any .pm module. So, I think using ns2html.pm is not a quick solution for me now.

        I think my program dies just on its beginning, on this track of code:

        ===
        #!perl ###################################################################### +#### # NS2HTML - The Netscreen to HTML file converter ###################################################################### +#### # Copyright (C) by # - 2007: Rodrigo Pace de Barros <rodrigo.pace.barros@gmail.com> # # This program is free software; you can redistribute it and/or modi +fy # it under the terms of the GNU General Public License as published +by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # ###################################################################### +#### # # File: ns2html.pl # is a part of NS2HTML # ################# # use lib "subs"; # use Tk; use Tk::LabFrame; use Getopt::Std; use encoding 'latin-1'; use File::Basename; use Tk::BrowseEntry; use File::Copy::Recursive; # require 'subs\\AddrCreator.pl'; require 'subs\\CreateIndex.pl'; require 'subs\\IfCreator.pl'; require 'subs\\ReadConf.pl'; require 'subs\\RouteCreator.pl'; require 'subs\\RuleCreator.pl'; require 'subs\\subs.pl'; require 'subs\\SvcCreator.pl'; require 'subs\\Log.pl';
        ===

        Thanks again!

        Rodrigo