Perrin Harkins schrieb:
> Thomas Wittek wrote:
>> The cursor on the DATA filehandle will be wrong:
> 
> I think you just need to rewind it after reading it.  See the docs for
> seek() and tell().  Here's an example:

No, the position is already wrong before any read. So saving it for
later purposes won't fix it.

The bug (?) even occurs in this minimal handler without any reads:

  #!/usr/bin/perl
  package TestHandler;
  sub handler {
    warn tell DATA;
    return 0;
  }
  1;
  __DATA__
  foobarbaz

Correct result without preloading of the module:

  93 at /mnt/data/pro/konstrukt/dev/lib/TestHandler.pm line 4.

Incorrect result when preloading it in a script which is loaded by
Apache's PerlRequire:

  103 at /mnt/data/pro/konstrukt/dev/lib/TestHandler.pm line 4.

The cursor is positioned at the end of the file. On some larger files it
is often positioned somewhere in the middle of the DATA section.

BTW: I forgot to post my configuration details:

  [EMAIL PROTECTED] dpkg -l | pcregrep '(libapache2-mod-perl2 |apache2 )'
  ii  apache2                    2.0.55-4.1 [..]
  ii  libapache2-mod-perl2       2.0.2-2    [..]
  [EMAIL PROTECTED] uname -a
  Linux server.zentrifuge.intra 2.6.17 #1 PREEMPT Tue Jul 11 02:32:04
CEST 2006 i686 GNU/Linux

Best regards

-- 
Thomas Wittek
http://gedankenkonstrukt.de/
Jabber: [EMAIL PROTECTED]

Reply via email to