in reply to Re: Problem with my .pl script. Helpppp!
in thread Problem with my .pl script. Helpppp!

Ok. I know what it's the difference between my and local , but
you don't tell me what it's the problem in my script.
  • Comment on Re: Re: Problem with my .pl script. Helpppp!

Replies are listed 'Best First'.
Re: Re: Re: Problem with my .pl script. Helpppp!
by PodMaster (Abbot) on Aug 31, 2003 at 14:30 UTC
    I may not use the words "your problem is" but I'm pretty sure I do point out an important one(study the code snippet, notice anything? when do the headers get printed? You do the same in your code, and webservers don't like it). CGI Help Guide covers everything there is to know about debugging programs in the CGI environment.

    At this point i'd like to refer you to About the PerlMonks FAQ -> How do I post a question effectively?. CGI Help Guide tell you how to get the detailed information How do I post a question effectively? tells you you're missing (ie, the detailed error messages).

    You should really go and read/tryout CGI Help Guide a couple of times now (once you read it it'll be easy for you to debug your program, and easier for others to help you).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      ok. All my script work ok, but if i write
      #!perl -wT use CGI::Carp('fatalsToBrowser'); use warnings; use CGI qw(:standard); use CGI::Cookie; use CGI; require "sub.pl"; require "variabile.pl"; ################################ my code....... ################################


      require "sub.pl"; and require "variabile.pl";
      don't work. The error it's : Can't locate sub.pl in @INC (@INC contains: C:/indigoperl/lib C:/indigoperl/site/lib) at c:\INDIGO~1\CGI-BIN\LC\ADMIN.PL line 9.
      . All my ( require "file.pl"; ) don't want to work. Whay?
        Because the locations of sub.pl and variable.pl are not being found by Perl. When you require a file, Perl looks inside the @INC array and tries to find files in the only 2 paths it has: C:/indigoperl/lib and C:/indigoperl/site/lib. If i were you, i would find the full path to the directory that contains those two files and add the following line BEFORE you require those two files:
        use lib '/path/to/my/files';
        Or, if that doesn't work:
        push @INC, '/path/to/my/files';
        You will have to replace that string with the proper path, of course. Please don't ask us what that proper path is, you will have to figure this one out. (hint: it's the full path of the folder that contains those two files that you want in include.)

        And please, dude. The word is why, not whay. I told you this once before. I get the feeling that you aren't listening ...

        jeffa

        L-LL-L--L-LL-L--L-LL-L--
        -R--R-RR-R--R-RR-R--R-RR
        B--B--B--B--B--B--B--B--
        H---H---H---H---H---H---
        (the triplet paradiddle with high-hat)
        
Re: Re: Re: Problem with my .pl script. Helpppp!
by chanio (Priest) on Aug 31, 2003 at 18:15 UTC
    Try not using modules for a while. So that you can see the power of plain perl commands.

    If you can manage to do what you want without a module, you are going to understand better how much would you be saving by using the CGI.pm and HTML::Template.pm.

    This is what I do when I am having trouble with some code. I start cutting unnecesary things until I get it working. Sometimes, I write more but in a simpler way that I know it has to work...

    Afterwards, I can start adding things on a working script and know what parts have to be rewritten.