Loading ...
Sorry, an error occurred while loading the content.

Re: Intermittent error in Included script

Expand Messages
  • Joshua Chamas
    ... In what package is WeekOfYear() defined and how it is supposed to be exported into the global.asa package? Is it using Exporter? Make sure that the
    Message 1 of 6 , Jan 3, 2002
    • 0 Attachment
      "John D. Leonard II" wrote:
      >
      > 2) Intermittently, the script works, or fails with a "Undefined
      > subroutine" error associated with "WeekOfYear"
      >
      > 3) The subroutine "WeekOfYear" is contained in a handrolled PM file. On
      > this server I don't have admin access, so I'm PUSHing the location of
      > the PM file onto the INC using the following code in my global.asa:
      >
      > ==========
      >
      > BEGIN{
      > push @INC,"/export/admin/jleonard/globals/ISG/CourseTools/blib/lib";
      > }
      >
      > use HTML::TreeBuilder;
      > use ISG::CourseTools;
      >
      > ==========
      >
      > My Script_OnStart, etc. are empty.
      >

      In what package is WeekOfYear() defined and how it is supposed to be
      exported into the global.asa package? Is it using Exporter?
      Make sure that the package that defines WeekOfYear() and exports
      it is used in global.asa so the import of WeekOfYear() can occur.
      Also make sure that WeekOfYear is being explicitly exported.

      Instead of BEGIN {}, try using "use lib qw(/path/)" for the
      same effect. This is not related to your problem, just cleaner.

      > 4) I'm running mostly defaults in the .htaccess file:
      >
      > PerlSetVar Global /export/admin/jleonard/globals/200202
      > PerlSetVar IncludesDir /export/admin/jleonard/globals/common
      > PerlSetVar StateDir /tmp/200202
      >

      FYI, Global acts an an IncludesDir... IncludesDir is nice when
      you want to share includes accross applications.

      If you get to the end of the line, and you need to make this work
      try something like this in global.asa:

      use Package;
      *WeekOfYear = *Package::WeekOfYear;

      This is by no means ideal, but if this works, and nothing else
      does, this may give us some clues.

      If you are using StatINC or StatINCMatch settings, try turning
      them off & see if that makes a difference.

      -- Josh
      _________________________________________________________________
      Joshua Chamas Chamas Enterprises Inc.
      NodeWorks Founder Huntington Beach, CA USA
      http://www.nodeworks.com 1-714-625-4051

      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • John D. Leonard II
      ... WeekOfYear()is exported in ISG::CourseTools. The ISG::CourseTools module was created using h2xs from the command line. My module test script
      Message 2 of 6 , Jan 3, 2002
      • 0 Attachment
        Joshua:

        > >
        > > use HTML::TreeBuilder;
        > > use ISG::CourseTools;
        > >
        >
        > In what package is WeekOfYear() defined and how it is
        > supposed to be exported into the global.asa package? Is it
        > using Exporter? Make sure that the package that defines
        > WeekOfYear() and exports it is used in global.asa so the
        > import of WeekOfYear() can occur. Also make sure that
        > WeekOfYear is being explicitly exported.

        WeekOfYear()is exported in ISG::CourseTools. The ISG::CourseTools
        module was created using "h2xs" from the command line. My module test
        script "t/weekofyear.t" works properly. Here is the top of my module:

        ===================================
        package ISG::CourseTools;

        require 5.005_62;
        use strict;
        use warnings;

        require Exporter;
        use AutoLoader qw(AUTOLOAD);

        use Time::Local;
        use Time::localtime;

        our @ISA = qw(Exporter);

        # Items to export into callers namespace by default. Note: do not export
        # names by default without a very good reason. Use EXPORT_OK instead.
        # Do not simply export all your public functions/methods/constants.

        # This allows declaration use ISG::CourseTools ':all';
        # If you do not need this, moving things directly into @EXPORT or
        @EXPORT_OK
        # will save memory.
        our %EXPORT_TAGS = ( 'all' => [ qw(
        WeekOfYear
        ) ] );

        our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

        our @EXPORT = qw(
        WeekOfYear
        );

        ================================

        > FYI, Global acts an an IncludesDir... IncludesDir is nice when
        > you want to share includes accross applications.

        Does "IncludeDir" also apply to any and all "use" commands?

        > If you are using StatINC or StatINCMatch settings, try
        > turning them off & see if that makes a difference.

        StatINC is set to the default (0). I explicitly set it and still get
        the same intermittent problem.

        I'll keep plugging.

        JL


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Joshua Chamas
        ... Sorry to take so long to get back to you on this. I am still getting caught up from the holidays! The only thing I can think of is that maybe StatScripts
        Message 3 of 6 , Jan 8, 2002
        • 0 Attachment
          "John D. Leonard II" wrote:
          > ...
          > WeekOfYear()is exported in ISG::CourseTools. The ISG::CourseTools
          > module was created using "h2xs" from the command line. My module test
          > script "t/weekofyear.t" works properly. Here is the top of my module:
          > ...

          Sorry to take so long to get back to you on this. I am still getting
          caught up from the holidays!

          The only thing I can think of is that maybe StatScripts was set to 0, but
          I didn't see the config info in your Debug error_log output to confirm.
          So make sure that PerlSetVar StatScripts 1 is set ( which is the default )...
          If there was a global.asa compiled that did not import WeekOfYear, and
          StatScripts was set to 0 & then you added the WeekOfYear import to global.asa,
          I could see how you might get this error if only intermittently.

          If you continue to have problems with this, try to emails a bit of
          error_log with Debug set to -3 from a fresh server restart to this
          problem occuring, that could help diagnose this better.

          > > FYI, Global acts an an IncludesDir... IncludesDir is nice when
          > > you want to share includes accross applications.
          >
          > Does "IncludeDir" also apply to any and all "use" commands?
          >

          No, just for including ASP includes.

          > > If you are using StatINC or StatINCMatch settings, try
          > > turning them off & see if that makes a difference.
          >
          > StatINC is set to the default (0). I explicitly set it and still get
          > the same intermittent problem.
          >
          > I'll keep plugging.
          >

          Let me know if I can help any more.

          --Josh

          _________________________________________________________________
          Joshua Chamas Chamas Enterprises Inc.
          NodeWorks Founder Huntington Beach, CA USA
          http://www.nodeworks.com 1-714-625-4051

          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        Your message has been successfully submitted and would be delivered to recipients shortly.