Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxx0cm, www.webdp.net, Event 9 IIS log failed to write entry, wwwxxx jeffs, Catastrophic failure Unexpected method call sequence. 0x8000ffff (-2147418113)., ksh lock a file, [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed, sed: -e expression #1, char 1: unterminated address regex, procmail + change subject, w2ksp4.exe download

Links

XODOX
Impressum

#1: Does a <Perl> section know where it is?

Posted on 2006-02-23 00:43:32 by Tyler MacDonald

I've been poking around in the documentation but I can't seem to
find this... Is there any way for a <Perl> section in a httpd.conf file to
know what file it's been evaluated out of? Ideally I'd like to be able to do
something similar to this for packaging mod_perl handlers and apache
configuration together:

<Perl>
use File::Basename ();
use File::Spec ();
my $me = Apache2::PerlSections->filename;
unshift @INC, File::Spec::catfile(File::Basename::dirname($me), "perl5lib");
</Perl>

Thanks,
Tyler

Report this message

#2: Re: Does a <Perl> section know where it is?

Posted on 2006-02-23 01:19:44 by jonathan vanasco

is this what you want?
$apr->location()


On Feb 22, 2006, at 6:43 PM, Tyler MacDonald wrote:

> I've been poking around in the documentation but I can't seem to
> find this... Is there any way for a <Perl> section in a httpd.conf
> file to
> know what file it's been evaluated out of? Ideally I'd like to be
> able to do
> something similar to this for packaging mod_perl handlers and apache
> configuration together:
>
> <Perl>
> use File::Basename ();
> use File::Spec ();
> my $me = Apache2::PerlSections->filename;
> unshift @INC, File::Spec::catfile(File::Basename::dirname($me),
> "perl5lib");
> </Perl>
>
> Thanks,
> Tyler
>

Report this message

#3: Re: Does a <Perl> section know where it is?

Posted on 2006-02-23 01:28:58 by jonathan vanasco

Correction:

$apr->location

no ()

its not a method. sorry about that.

On Feb 22, 2006, at 7:19 PM, Jonathan Vanasco wrote:

>
> is this what you want?
> $apr->location()

Report this message

#4: Re: Does a <Perl> section know where it is?

Posted on 2006-02-23 01:32:58 by Tyler MacDonald

Jonathan Vanasco <jon@2xlp.com> wrote:
>
> is this what you want?
> $apr->location()


What class is that method a part of? I didn't see anything about
"location" in PerlSections...

Apache2::Directive seems to have what I'm after (filename and
line_num methods), if I cold only get a Apache2::Directive object
representing the current <Perl> section..

- Tyler

Report this message

#5: Re: Does a <Perl> section know where it is?

Posted on 2006-02-23 01:43:31 by jonathan vanasco

its part of Apache Request

it should be the location container

i misinterpreted yoru question though. sorry about that .. its not
what you needed. i thought you meant what directory mapping its
being evaluated from.

you're looking for the mod_perl equivalent of the php scriptname or
whatever its called. that i don't know.

sorry for the confusion.



On Feb 22, 2006, at 7:32 PM, Tyler MacDonald wrote:

> What class is that method a part of? I didn't see anything about
> "location" in PerlSections...
>
> Apache2::Directive seems to have what I'm after (filename and
> line_num methods), if I cold only get a Apache2::Directive object
> representing the current <Perl> section..
>
> - Tyler
>

Report this message

#6: Re: Does a <Perl> section know where it is?

Posted on 2006-02-23 01:47:33 by Tyler MacDonald

You know what?

The mod_perl people are freaking geniuses.

This works:

<Perl >
warn __FILE__, " - ", __LINE__, "\n";
</Perl>

crackerjack:/home/faraway/dev# apache2ctl stop
/home/faraway/dev/test.conf - 5


That is sooooooooo slick!

- Tyler




Jonathan Vanasco <jon@2xlp.com> wrote:
>
> its part of Apache Request
>
> it should be the location container
>
> i misinterpreted yoru question though. sorry about that .. its not
> what you needed. i thought you meant what directory mapping its
> being evaluated from.
>
> you're looking for the mod_perl equivalent of the php scriptname or
> whatever its called. that i don't know.
>
> sorry for the confusion.
>
>
>
> On Feb 22, 2006, at 7:32 PM, Tyler MacDonald wrote:
>
> > What class is that method a part of? I didn't see anything about
> >"location" in PerlSections...
> >
> > Apache2::Directive seems to have what I'm after (filename and
> >line_num methods), if I cold only get a Apache2::Directive object
> >representing the current <Perl> section..
> >
> > - Tyler
> >
>

Report this message

#7: Re: Does a <Perl> section know where it is?

Posted on 2006-02-23 23:18:57 by gozer

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig29AA9D0425219DCEC17D30C6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Tyler MacDonald wrote:
> You know what?
>
> The mod_perl people are freaking geniuses.
>
> This works:
>
> <Perl >
> warn __FILE__, " - ", __LINE__, "\n";
> </Perl>

That's a feature, actually. I am afraid it isn't documented
anywhere though, so +1 for finding this solution ;-)

A bonus point would be awarded for a documentation patch ;-)

------------------------------------------------------------ --------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

--------------enig29AA9D0425219DCEC17D30C6
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFD/jTRyzKhB4jDpaURA4UOAKDBkfQ7tzdMTWRe8bPcUG1HjH+OtQCe O/6/
EthHKiNmEekb+CBM9zfnLiY=
=zccG
-----END PGP SIGNATURE-----

--------------enig29AA9D0425219DCEC17D30C6--

Report this message