Re: HTML Template Comparison Sheet ETA

2000-08-14 Thread Matt Sergeant

On Tue, 15 Aug 2000, Gunther Birznieks wrote:

> Is there an ETA on when this will be out?
> 
> I know everyone is busy, but I just figured I would ask. There have been 
> hundreds of template messages generated in the last weeks on this topic, 
> and then it seems to have gone a bit quiet (as usual).

If nobody is working on it, I suggest just getting 1 or 2 paragraph
synopsis from template authors about thier product. Just compile those
together and then let it evolve as people see other people's paragraphs
and think "Hey I should have mentioned X too...".

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




Re: What's this error?

2000-08-14 Thread Alan E. Derhaag

Paul <[EMAIL PROTECTED]> writes:

> > > I have also noted a fair amount of 
> > > [Wed Jul 19 16:01:58 2000] [notice] child pid 24703 exit signal
> > > Segmentation Fault (11)
> 
> I get this, too, a *LOT*.
> 
> > Err... I'm convinced that our current mod_ssl 2.6.5 is 100% stable
> > and does not produce any segfaults. If you really get segfaults, some
> > other component causes it.  Let me guess: You're running PHP or 
> > mod_ssl+OpenSSL as a DSO underf Solaris, right?
> 
> Forgive the "me, too"-ism, here, but this problem just won't seem to go
> away.  I'm running on HP-UX B.10.20 (best the company will spring for)
> on a PARISC1.1 9000/891.  I probably did build DSO, though, and I
> really don't need it. Hmm think the same prob might apply here?
> 
> > If no, then I've no clue and you have to attach a debugger to find
> out
> > where it segfaults.
> 
> Somebody suggest a debugger? I'm feeling pretty ignorant, here, and
> unfortunately won't have any time to RTFM for a few weeks yet.
> (~mumblegrumble~)

Recently, I had such a concurrence and traced it to a module (loaded
with startup.pl) that was bombing at the initialization when first run
by an access.  Dropping the modules from startup.pl improved the debug
output and allowed tracing its failure.



Multiple PerlAccessHandlers problem.

2000-08-14 Thread Trevor Phillips

I'm having problems with a mix of PerlAccessHandlers. I have two handlers, and
it is required that one be defined in a  block, and the other
currently in .htaccess' as required.

The problem is that the one in the .htaccess is being completely ignored when I
have the one in the Locate block. ie;

In httpd.conf:


PerlAccessHandler XXX


In a .htaccess:

PerlAccessHandler YYY

So, XXX takes effect, but YYY is ignored.

If I take out the Location one and have both in the .htaccess:

PerlAccessHandler XXX YYY

Or even on separate lines:

PerlAccessHandler XXX
PerlAccessHandler YYY

Then it all works, but when XXX is in a Location, it overrides all .htaccess
references.

Is this supposed to be the correct behaviour? How do I get the behaviour I
want? (One in a Location, and one in .htaccess).

OS is Linux, mod_perl is still 1.21.x on these servers.

Thanks in advance...

-- 
. Trevor Phillips -   http://jurai.murdoch.edu.au/ . 
: CWIS Systems Administrator -   [EMAIL PROTECTED] : 
| IT Services   -   Murdoch University | 
 >--- Member of the #SAS# & #CFC# <
| On nights such as this, evil deeds are done. And good deeds, of /
| course. But mostly evil, on the whole. /
 \  -- (Terry Pratchett, Wyrd Sisters)  /



Re: AIX 4.3.2, perl 5.6, mod_perl 1.24, apache 1.3.12 installation problems

2000-08-14 Thread Hey Boy

Thanx Jenus-Uwe Mager for the patch. Now i have finally installed mod 
perl
It was hell
Just a hint for others who are having troubles with mod perl and AIX.
I installed perl 5.6.0 with the patch, while running sh Configure
I included -L/usr/local/lib/gcc-lib/blah/blah <-- *Important*
when being prompted for inculding any other libraries when compling...
during the configuration process.
your machine might have it somewhere else try to find it and use gcc...
My gcc version was 2.95. and in the blah blah directory was libgcc.a and the 
rest of the goodies.
I installed all modules (DBI, Socket, etc) as static while building perl.

Now once u get into mod_perl I used these commands
perl Makefile.PL \
APACHE_PREFIX=/usr/local/apache \
APACHE_SRC=../apache_1.3.12/src \
USE_APACI=1 \
DO_HTTPD=1 EVERYTHING=1 \
APACI_ARGS='--prefix=/usr/local/apache'

make; make test; make install

Everything went smooth and mod_perl was installed in:)
$> httpd -l
showed mod_perl.c

I finally figured out why all these problems were created because my gcc-lib 
was installed in a weird location. Now this is just one case of AIX with 
perl5.6.0, apache 1.3.12 but I hope my experience would help someone who 
could have the same problem with mod_perl:)

Bye,
Taswar

Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com




Re: caching dynamic pages

2000-08-14 Thread Ken Williams

You might check out HTML::Mason, whose caching structure is second to
none I have seen.

Robert Friberg wrote:
> 
> Hi all,
> 
> I'm new to modperl but not perl, running a standard RH 6.0
> with the modperl RPM off apache.org. I'm generating pages
> from a mysql db which change maybe 3 times a week. The
> expected traffic will be between 1000 and 1 hits
> per day. Obviously I would like to cache some of the
> common pages and maybe some raw table data.
> 
> My question is where should I put the var and how do I access it?
> I don't want one copy for each child, so I should go for the
> startup file, right?
> 
> tia,
> --
> robert friberg, ensofus ab
> +46(0)708 98 57 01



Re: HTML Template Comparison Sheet ETA

2000-08-14 Thread Perrin Harkins

On Tue, 15 Aug 2000, Gunther Birznieks wrote:
> Was someone (or somepersons) committed to doing this or is the project 
> seeking volunteers or both?

Drew Taylor <[EMAIL PROTECTED]> was working on the first cut, and I was
planning to add some things on to that.  As with The Guide, I'm sure that
all contributed information will be welcome, but I'd suggest waiting for
the first draft to avoid duplicating Drew's work.

- Perrin




Re: $r->notes with slashes

2000-08-14 Thread Ken Williams

Geoffrey Young wrote:
> 
> > -Original Message-
> > From: Andrew Fuqua [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, August 14, 2000 12:44 PM
> > To: [EMAIL PROTECTED]
> > Subject: $r->notes with slashes
> >
> >
> > I'm trying to pass a path name with slashes as the value of a
> > note, and
> > when I try to retrieve the note from another handler in the same
> > request, the note is not there.  Code goes like this:
> >
> > in a PerlInitHandler:
> > $r->notes('dir_name' => '/some/dir/name/');
> >
> > later, in a PerlAuthzHandler:
> > my $dir_name = $r->notes('dir_name');
> >
> > and $dir_name is empty. :(   I can set and retrieve the note just fine
> > as long as there are no slashes in the note.
> 
> try pnotes:
> $r->pnotes(dir_name => $some_string);
> or
> $r->pnotes(dir_name => \$some_string);

If that works, then $r->notes is broken and needs to be fixed.  My guess
is that it would be an Apache problem, not a mod_perl specific one.



HTML Template Comparison Sheet ETA

2000-08-14 Thread Gunther Birznieks

Is there an ETA on when this will be out?

I know everyone is busy, but I just figured I would ask. There have been 
hundreds of template messages generated in the last weeks on this topic, 
and then it seems to have gone a bit quiet (as usual).

Was someone (or somepersons) committed to doing this or is the project 
seeking volunteers or both?

Thanks,
 Gunther
__
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Web Technology Company
http://www.extropia.com/




Re: Text::Template, PACKAGES, ModPerl

2000-08-14 Thread John Hurst

"goEbusiness.com Mail Lists" wrote:
> 
> Ok, here's the scenarious.

> Is there a quick easy way to reset all of those variables for
> each time the script is run?  I'm assuming no.  I did make a
> function that ran through the package, like so:


>From my own bag-o-tricks, this simply obliterates the contents of
the desired package. YMMV.

# Nuke the template's package namespace.
# Based on the inner workings of Safe
#
sub _kill_package {
my $package = shift;

no strict 'refs';
my $pkg = "main::$package\::"; # expand to full symbol table name
my ($stem, $leaf) = $pkg =~ m/(.*::)(\w+::)$/;

my $stem_symtab = *{$stem}{HASH};

if(my $leaf_glob = $stem_symtab->{$leaf}){
my $leaf_symtab = *{$leaf_glob}{HASH};
%$leaf_symtab = ();
return(1);
}

return();
}


-jh



Re: caching dynamic pages

2000-08-14 Thread Yann Ramin

Why not do what I do... have a croned Perl script which generates static
HTML documents?  If that isn't an option, try using HTML::Template's
cache option which can boost performance.

Yann

Robert Friberg wrote:
> 
> Hi all,
> 
> I'm new to modperl but not perl, running a standard RH 6.0
> with the modperl RPM off apache.org. I'm generating pages
> from a mysql db which change maybe 3 times a week. The
> expected traffic will be between 1000 and 1 hits
> per day. Obviously I would like to cache some of the
> common pages and maybe some raw table data.
> 
> My question is where should I put the var and how do I access it?
> I don't want one copy for each child, so I should go for the
> startup file, right?
> 
> tia,
> --
> robert friberg, ensofus ab
> +46(0)708 98 57 01

-- 


Yann Ramin  [EMAIL PROTECTED]
Atrus Trivalie Productions  www.redshift.com/~yramin
Monterey High ITwww.montereyhigh.com
ICQ 46805627
AIM oddatrus
Marina, CA

IRM Developer   Network Toaster Developer
SNTS Developer  KLevel Developer

(yes, this .signature is way too big)

"All cats die.  Socrates is dead.  Therefore Socrates is a cat."
- The Logician

THE STORY OF CREATION

In the beginning there was data.  The data was without form and null,
and darkness was upon the face of the console; and the Spirit of IBM
was moving over the face of the market.  And DEC said, "Let there be
registers"; and there were registers.  And DEC saw that they carried;
and DEC seperated the data from the instructions.  DEC called the data
Stack, and the instructions they called Code.  And there was evening
and there was a maorning, one interrupt...
-- Rico Tudor

William Safire's Rules for Writers:

Remembe



Re: Text::Template, PACKAGES, ModPerl

2000-08-14 Thread ___cliff rayman___


"goEbusiness.com Mail Lists" wrote:

> Ok, here's the scenarious.
>
> Runnign Text::Template with a PACKAGE.  Let's just call it M.
>
> So, for example, I have a script
>
> $M::fill_me_in and Text::Template will fill that variable in.
>
> Anyway, I know that those are global variables, so when I enable mod_perl, they 
>retain the previous values.
>
> Is there a quick easy way to reset all of those variables for each time the script 
>is run?  I'm assuming no.  I did make a function that ran through the package, like 
>so:
>
> my ($key,$value) ;
>
> foreach $key (sort keys %main::M::) {

foreach $key (keys %::M::){ #the stash is not in any package

>
> my $value = $main::M::{$key} ;

the line above is useless.  you were probably using for debugging?

>
> $main::M::{$key} = "" ; # reset to blank

${$::M::{$key}}=undef;

>
> }
>
> and placing that at the bottom of the mod perl enabled script...but it doesn't work.

it will work now.
you may want to rethink your code before going throught this for every call.
also, there might be a better way to reset globals, but the changes i provided should 
correct the script above.

>
>
> I tried "reset 'M'" and that also doesn't work.
>
> Any thoughts on this?  The short term solution I have come up with is that in every 
>sub/package/whatever I reset those variables to blank each time the subroutine that 
>would fill those in is called.  Is that the best way to do it?  I would think the way 
>I mentioned above would work, but maybe I just have to call that from each sub 
>routinue.
>
> Thanks,
> Bill
> [EMAIL PROTECTED]

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/





Text::Template, PACKAGES, ModPerl

2000-08-14 Thread goEbusiness.com Mail Lists

Ok, here's the scenarious.

Runnign Text::Template with a PACKAGE.  Let's just call it M.

So, for example, I have a script

$M::fill_me_in and Text::Template will fill that variable in.

Anyway, I know that those are global variables, so when I enable mod_perl, they retain 
the previous values.

Is there a quick easy way to reset all of those variables for each time the script is 
run?  I'm assuming no.  I did make a function that ran through the package, like so:

my ($key,$value) ;

foreach $key (sort keys %main::M::) {
my $value = $main::M::{$key} ; 
$main::M::{$key} = "" ; # reset to blank 
}

and placing that at the bottom of the mod perl enabled script...but it doesn't work.

I tried "reset 'M'" and that also doesn't work.

Any thoughts on this?  The short term solution I have come up with is that in every 
sub/package/whatever I reset those variables to blank each time the subroutine that 
would fill those in is called.  Is that the best way to do it?  I would think the way 
I mentioned above would work, but maybe I just have to call that from each sub 
routinue.

Thanks,
Bill
[EMAIL PROTECTED]




Session manager(s)-how to set an outbound session ?

2000-08-14 Thread Greg Cope

Dear All

I'm writing a Session-Manager (transhandler) i.e deals with getting a
session id from cookies, uri, or query args, and sets one and redirects
if neccessary.  This is meant to compliment Apache::Session - in that
you use Apache::Session to store your session data.

Thanks to Mat and Eric (for the addhandler issue yesterday) I can:

- get a session from cookies, query args or via URI rewriting
- change the order of the last two (i.e look in uri first, query args
secound, or args first, uri secound).
- Only look in cookies, or args or uri.
- redirect if needed to set a session if none is found(default to one -
configurable to off) .
- match a uri to "session" i.e session-ing can be switched off for
certain uri's.
- store the session id / whether cookies are on / off in either pnotes
or $ENV{}
- debugging can be set for copious info on whats going on.

- Note there is no validation of the session - this just fetches the
session id, validating is up to other handlers.

- I'm adding in a check_cookie funtionality that will try to set a
cookie and then redirect to itself with a check in the URI, if no
session is found.

- lots of bonus unexplained funtionality  aka bugs I'v not found or
fixed.

Much of the code is a rehash of the examples in Apache Modules in Perl &
C.

Now I want to deal with out-bound content/session ids - obviously
cookies are easy as these could just be set in the transhandler and a
ref placed in pnotes (and $ENV although I'm not sure on this bit as I've
not tried it).

But what to do with args or uri sessioning ?

If relative urls are used the session appears to be preserved in
netscape between different uri's (if using uri's).  This means I can do
reasonable transparent session handling with Cookies or URI mangling
(ignoring session id leakage at this point).  This works quite well (I
happy with it!).

Adding to the args of links is a different question - any one any clues
? 

I will either have to say that adding a session to your links if cookies
are off is your issue within your content handler, or find a way of
manipulating them - anyone any ideas ?

If anyone wants a peek I can send them the code or post it here if
there'ss demand.  Its my secound stab, and the logic/ style / efficiency
may leave something to be desired - constructive flames welcome!

The main aim/motivation is for a very simple ecommerce thing where
sessions are vital - and offsite/exterior links are few and exit points
want to be tracked - hence URI rewriting is acceptable and a redirector
is handy.  Transparent session handling is a "nice" design goal.

I may also throw in a redirector that will strip session args (if I can
get $r->args(undef) to work ) and/or uri's (which can help with exit
tracking etc ...) before redirecting to the link to help with session
leaks.

Greg



Re: my transhandler runs only once in each child ?!?

2000-08-14 Thread Greg Cope

Matt Sergeant wrote:
> 
> On Sun, 13 Aug 2000, Greg Cope wrote:
> 
> > Apache->push_handlers("PerlTransHandler", \&transhandler);
> 
> push_handlers is temporary, not permanent. And this line only gets
> executed once.

Thanks Mat - Explains everything.  I though it might be something as
simple as this, I'll birch myself later.

I spent hours yesterday looking at this. Doh,  Doh,  Doh !!!

Thanks again

Greg

ps You're up early


> 
> --
> 
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org




Re: my transhandler runs only once in each child ?!?

2000-08-14 Thread Greg Cope

Eric Cholet wrote:
> 

> >
> > Apache->push_handlers("PerlTransHandler", \&transhandler);
> 
> this will trigger the handler for the first request. Nothing
> will trigger it for subsequent requests. If you want it to run
> for every request, why not just drop the push_handlers call
> and add PerlTransHandler tinasm::Session to httpd.conf.

Thanks Eric,

IIRC I had tried that arround a month ago -  and it did not work - but
the bug was elsewhere.  The reason I was doing it this way was so that I
could just do a :

use tinasm::Session;

in a statup file - which I think is {now think was} more elegant that
adding a transhandler, that'll teach me!

Now all working thanks

Greg

> 
> >
> > sub transhandler {
> >
> > my $r = shift;
> > unless ($r->uri =~ m!$DIR_MATCH!o) {
> > print STDERR "SESSION-MANAGER-$$-URI not matched\n"
> > if $DEBUG;
> > return DECLINED;
> > }
> >
> > print STDERR "SESSION-MANAGER-$$-URI match\n" if $DEBUG;
> >
> > . handler goes on for another 200 lines so I've snipped it - if
> > anyone wants to look at it drop me a line.
> 
> --
> Eric





Re: URI->Filename translation phase seems to be failing

2000-08-14 Thread Randal L. Schwartz

> "darren" == darren chamberlain <[EMAIL PROTECTED]> writes:

darren> Does declining non-html files help? I.e.,

darren> sub handler {
darren> my ($r) = @_;
darren> return DECLINED unless ($r->content_type eq 'text/html');
darren> # Process HTML file...
darren> return OK;
darren> }

darren> I would think that this would skip directory accesses and run when
darren> mod_autoindex does it's internal redirect.

Even more precisely, I did the similar thing in Stonehenge::Pictures
.  If
$r->content_type is DIR_MAGIC_TYPE, and $r->uri does not match /\/$/,
then I return DECLINED.  Which mod_dir will then send the redirect
for.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



RE: $r->notes with slashes

2000-08-14 Thread Geoffrey Young



> -Original Message-
> From: Andrew Fuqua [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 14, 2000 12:44 PM
> To: [EMAIL PROTECTED]
> Subject: $r->notes with slashes
> 
> 
> I'm trying to pass a path name with slashes as the value of a 
> note, and
> when I try to retrieve the note from another handler in the same
> request, the note is not there.  Code goes like this:
> 
> in a PerlInitHandler:
> $r->notes('dir_name' => '/some/dir/name/');
> 
> later, in a PerlAuthzHandler:
> my $dir_name = $r->notes('dir_name');
> 
> and $dir_name is empty. :(   I can set and retrieve the note just fine
> as long as there are no slashes in the note.

try pnotes:
$r->pnotes(dir_name => $some_string);
or
$r->pnotes(dir_name => \$some_string);

> 
> Another question.  From a handler, how can I change the value of a
> variable that was PerlSetVar'ed in httpd.conf?

you can use Apache::Table to get or set things in PerlSetVar:
$r->dir_config->get('foo');
$r->dir_config->set(foo => 'changed');

I haven't changed PerlSetVar like this, but a quick test showed that it
worked ok...

I've noticed that the Apache::Table way only works for PerlSetVar things on
a per-directory basis - it doesn't seem to inherit per-server variables
properly at this time...

HTH

--Geoff

> 
> Thanks,
> Andrew
> 



Re: URI->Filename translation phase seems to be failing

2000-08-14 Thread root

yes, that solved the problem.  thanks a lot.   

one minor point: it still seems like the directory to file transition should
take place during the uri->filename translation to me.  but i guess that's
an issue for another list.

thanks again. 

brady richards

On Mon, Aug 14, 2000 at 02:15:13PM -0400, darren chamberlain wrote:
> Brady Richards ([EMAIL PROTECTED]) said something to this effect:
> > [...]
> > we're running apache 1.3.12 and mod_perl (EVERYTHING=1) 1.3.24, and we 
> > have written a little handler to do some simple find and replace in 
> > html files before returning them.  it works fine when given and explicit 
> > url (http://foo.com/bar/index.html) but on a request to http://foo.com/bar/
> > or http://foo.com/bar, the filename that $r->filename() gives is 
> > /base/dir/bar/ and /base/dir/bar respectively.  shouldn't the translation 
> > handler have kicked in already and changed this for me?  
> > 
> > [...]
> > 
> > brady richards
> 
> Does declining non-html files help? I.e.,
> 
> sub handler {
> my ($r) = @_;
> return DECLINED unless ($r->content_type eq 'text/html');
> # Process HTML file...
> return OK;
> }
> 
> I would think that this would skip directory accesses and run when
> mod_autoindex does it's internal redirect.
> 
> (darren)
> 
> -- 
> (1) Everything depends.
> (2) Nothing is always.
> (3) Everything is sometimes.



$r->notes with slashes

2000-08-14 Thread Andrew Fuqua

I'm trying to pass a path name with slashes as the value of a note, and
when I try to retrieve the note from another handler in the same
request, the note is not there.  Code goes like this:

in a PerlInitHandler:
$r->notes('dir_name' => '/some/dir/name/');

later, in a PerlAuthzHandler:
my $dir_name = $r->notes('dir_name');

and $dir_name is empty. :(   I can set and retrieve the note just fine
as long as there are no slashes in the note.

Another question.  From a handler, how can I change the value of a
variable that was PerlSetVar'ed in httpd.conf?

Thanks,
Andrew




Re: URI->Filename translation phase seems to be failing

2000-08-14 Thread darren chamberlain

Brady Richards ([EMAIL PROTECTED]) said something to this effect:
> hi all,
> 
> this is probably a bone headed question, but two of us here have been
> beating our heads against it for a day and a half now, so i figure i 
> might as well ask (since i couldn't find an answer in the docs or the 
> archives).  
> 
> we're running apache 1.3.12 and mod_perl (EVERYTHING=1) 1.3.24, and we 
> have written a little handler to do some simple find and replace in 
> html files before returning them.  it works fine when given and explicit 
> url (http://foo.com/bar/index.html) but on a request to http://foo.com/bar/
> or http://foo.com/bar, the filename that $r->filename() gives is 
> /base/dir/bar/ and /base/dir/bar respectively.  shouldn't the translation 
> handler have kicked in already and changed this for me?  
> 
> i would have given up and had the module do its own directory to file 
> translation, but it seems that there is no way to access the DirectoryIndex
> setting from within the module.  perhaps tied up in this is the fact the 
> $r->dir_config( ) returns a reference to an empty array.
> 
> short snippet of http.conf
> 
> 
> DirectoryIndex index.php index.phtml index.html index.taf
> 
> 
> PerlModule NetCloak::Processor
> 
>AddHandler perl-script .html .htm
>PerlHandler NetCloak::Processor
>PerlSendHeader On
> 
> 
> any ideas?  thank you
> 
> brady richards

Does declining non-html files help? I.e.,

sub handler {
my ($r) = @_;
return DECLINED unless ($r->content_type eq 'text/html');
# Process HTML file...
return OK;
}

I would think that this would skip directory accesses and run when
mod_autoindex does it's internal redirect.

(darren)

-- 
(1) Everything depends.
(2) Nothing is always.
(3) Everything is sometimes.



Problem with DBI

2000-08-14 Thread Daniel Martinez

Hi!
I have apache 1.3.12 and the latest DBI running on Sparc Solaris 2.7. when
i try to run an embedded perl script that makes use of the DBI i get the
following error:

ld.so.1: perl: fatal: relocation error: file
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/DBD/mysql/mysql.so: symbol
mysql_init: referenced symbol not found
Killed

Any help please?






Re: Adding an entry into .htpasswd

2000-08-14 Thread Todd Caine

RTFM.  Use the -b flag to htpasswd.

Shuba Simha wrote:

> Can anybody tell  me if there is any way to add an entry into ".htpasswd"
> from a perl script, without getting prompted for the password? Meaning..I
> have the password in a variable(say $new_pass),  & want to change the
> password of a particular user from old_pass to $new_pass. How can this be
> done through the script, without getting the prompt to "Type new password"?
>
> Any help ASAP is very much appreciated.
> Thanks..
> Shuba
>
>   
>   Name: winmail.dat
>winmail.datType: application/ms-tnef
>   Encoding: base64

--
--

 

--





RE: Adding an entry into .htpasswd

2000-08-14 Thread Carlos Ramirez

Look into HTTPD::UserAdmin and HTTPD::GroupAdmin modules from
CPAN.




--Original Message--
From: "Shuba Simha" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Sent: August 14, 2000 4:16:17 PM GMT
Subject: Adding an entry into .htpasswd


Can anybody tell  me if there is any way to add an entry into ".htpasswd"
from a perl script, without getting prompted for the password? Meaning..I
have the password in a variable(say $new_pass),  & want to change the
password of a particular user from old_pass to $new_pass. How can this be
done through the script, without getting the prompt to "Type new password"?

Any help ASAP is very much appreciated.
Thanks..
Shuba





RE: Adding an entry into .htpasswd

2000-08-14 Thread jbodnar

CPAN is your friend:

http://search.cpan.org/doc/KMELTZ/Apache-Htpasswd-1.3/Htpasswd.pm

On 14-Aug-2000 Shuba Simha wrote:
> Can anybody tell  me if there is any way to add an entry into ".htpasswd"
> from a perl script, without getting prompted for the password? Meaning..I
> have the password in a variable(say $new_pass),  & want to change the
> password of a particular user from old_pass to $new_pass. How can this be
> done through the script, without getting the prompt to "Type new password"?
> 
> Any help ASAP is very much appreciated.
> Thanks..
> Shuba
> 
> 
> 
> 
> 

-- 
Jason Bodnar + [EMAIL PROTECTED] + Team Linux

Rock 'n' Roll had become stagnant.  `Achy Breaky Heart' was seven years
away.  Something had to fill the void, and that something was barbershop.

-- Homer Simpson
   Homer's Barbershop Quartet




URI->Filename translation phase seems to be failing

2000-08-14 Thread Brady Richards

hi all,

this is probably a bone headed question, but two of us here have been
beating our heads against it for a day and a half now, so i figure i 
might as well ask (since i couldn't find an answer in the docs or the 
archives).  

we're running apache 1.3.12 and mod_perl (EVERYTHING=1) 1.3.24, and we 
have written a little handler to do some simple find and replace in 
html files before returning them.  it works fine when given and explicit 
url (http://foo.com/bar/index.html) but on a request to http://foo.com/bar/
or http://foo.com/bar, the filename that $r->filename() gives is 
/base/dir/bar/ and /base/dir/bar respectively.  shouldn't the translation 
handler have kicked in already and changed this for me?  

i would have given up and had the module do its own directory to file 
translation, but it seems that there is no way to access the DirectoryIndex
setting from within the module.  perhaps tied up in this is the fact the 
$r->dir_config( ) returns a reference to an empty array.

short snippet of http.conf


DirectoryIndex index.php index.phtml index.html index.taf


PerlModule NetCloak::Processor

   AddHandler perl-script .html .htm
   PerlHandler NetCloak::Processor
   PerlSendHeader On


any ideas?  thank you

brady richards



Adding an entry into .htpasswd

2000-08-14 Thread Shuba Simha

Can anybody tell  me if there is any way to add an entry into ".htpasswd"
from a perl script, without getting prompted for the password? Meaning..I
have the password in a variable(say $new_pass),  & want to change the
password of a particular user from old_pass to $new_pass. How can this be
done through the script, without getting the prompt to "Type new password"?

Any help ASAP is very much appreciated.
Thanks..
Shuba






 winmail.dat


RE: Problem with form data using mod_perl and CGI.pm

2000-08-14 Thread Tom Mornini

> > > What is the best way to define a global value like $query if I want to
> > > 'use strict'.  I really don't want to be passing $query to all my
> > > subroutines.  I could package define it as $main::query but that seems
> > > awkward.

> "perldoc perlref" addresses the nested subroutine problem, and
> suggests using something like this:
> 
>   local *printQueryParams = sub {
> 
> instead of this:
> 
>   sub printQueryParams {
> 
> The assignment to the typeglob is pretty slick in that it let's you
> call the anonymous subroutine as if it were a subroutine named
> printQueryParams.

How about just:

use vars qw ( $query );

to define a package global?

-- 
-- Tom Mornini
-- InfoMania Printing and Prepress




env in background process

2000-08-14 Thread Niraj Sheth

Hi,

I am having very strange problem with environment variables.

>From Apache::PerlRun script(cgi) I am setting env and firing background
process ..
system("$command &") (or print `$command &`;)

now looks like environment variable being persistence b/w different
requests ONLY in background process. so it's looks to me that mod_perl
is setting proper "Perl Level" env but failing to reset env at "c level"
or "process level". I know it's sounds very weird.
/perl-status?env is printing correctly but my background process
($command) is printing few extra env, which i set it in different cgi
script.

e.g. "script1.pl" is setting $ENV{foo1} = "foo1" and firing print
`command1 &`;
and "script2.pl" is setting $ENV{foo2} = "foo2" and firing print
`command2 &`;

after few hits both env(foo1 and foo2) are visible to both background
processes.
while /perl-status?env is displaying correctly.
Here command1 and command2(perl scripts) are just printing env

Apache/1.3.9 (Unix) mod_perl/1.21
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
osname=solaris, osvers=2.6, archname=sun4-solaris
uname='sunos nlsun268 5.6 generic_105181-14 sun4u sparc sunw,ultra-4
'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='gcc', optimize='-O', gccversion=2.8.1
cppflags='-I/usr/local/include'
ccflags ='-I/usr/local/include'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Any comments?

Thanks,
Niraj




proxy authentication

2000-08-14 Thread Tubbs, Derric L

I've rolled my own mod_perl authentication handler using basic
authentication.  It works fine (AFAIK).  It's been in place and working for
non-proxied areas of the site for several months.  I am trying to proxy
another web site at my location via ProxyPass directives but IE 5 keeps
crashing on it (figures) and Netscape gives the old "Proxy Authentication
Required", but both only if I try to go straight to the proxied site.  If I
first login to my site, and then go to the proxied area it works fine.  Any
ideas?  Do you need more info?  Thanks

Apache/1.3.6 (Unix) mod_perl/1.21

Derric L. Tubbs
CITIS Administrator
The Boeing Company
Fort Walton Beach, Florida
[EMAIL PROTECTED]
(850)302-4494



Re: Bug in Apache::ASP XMLSubs when an argument includes '>'-characters?

2000-08-14 Thread Matt Sergeant

On Fri, 11 Aug 2000, Henrik Tougaard wrote:

> I have been trying to test the limits of the nice new XMLSub feature in
> Apache::ASP, and seem to have discovered a bug.
> 
> With this simple .asp page I get an error:
> 
>  
> [My XMLSubMatch is set to Fiks:\w+  - the name of the subroutine doesn't
> matter]
> 
> It seems as if the '>' in the '' argument confuses the parser.

[snip]

> Is this a (mis)feature or a parser bug?

parser bug - it should have died earlier at the < sign :-)

XML attributes can't contain "<" or "&" characters, or the same quote that
they are surrounded by. The following are the encodings you can use
(and XMLSubsMatch needs to unravel):

<   =>  "<"
>   =>  ">"
&   =>  "&"
"   =>  """
'   =>  "'"

Note that only "<" is needed for your example (since encoding the
">" isn't mandatory in XML generally).

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




AutoIndex.pm reading autoindex directives

2000-08-14 Thread George Sanderson

Well I finally got AutoIndex to load and run.  But, . . . It does not read
the autoindex directives from the httpd.conf file.  I believe these are
suppose to be processed by Apache::Icon.

My httpd.conf is:
#
PerlModule Apache::AutoIndex
PerlModule Apache::Icon
SetHandler perl-script
PerlHandler Apache::AutoIndex
PerlTransHandler Apache::AutoIndex->transhandler
#
Note that in order to get the last line to work I had modify the
transhandler method in order to make it a object-oriented (sub transhandler
($$)) method.

Can someone please point me in the right direction so that
AutoIndex.pm/Icon.pm read and process the httpd.conf autoindex directives?
Thank you.




Re: Apache 1.3.12/mod_perl 1.24/Perl 5.6.0 crash

2000-08-14 Thread George Sanderson

I was able to get the Apache::AutoIndex module to load and run by
statically building mod_perl into Apache.  Thanks.

Somebody should fix the flaky DSO.  I did notice that the problems are
timing related.  I would could get different results when I did a fast
"apachectl stop", "apachectl start" (the RedHat /etc/rc.d/init.d/httpd does
this) as opposed to a slow sequence.

>I have Apache 1.3.12 using mod_perl 1.24 as a DSO, built with Perl 5.6.0
using
>Apache::AutoIndex 0.08 which is running on Linux 2.2.14. 
>Everything works fine, until, I `apachectl stop`, then add the following
to the httpd.conf:
>PerlModule Apache::AutoIndex
>When I do `bin/httpd -X` Linux does a core dump.

In the process, I noticed the awkwardness of the httpd.conf
"LoadModule","AddModule" directive pair.

Apache's httpd knows which modules are statically linked (evidenced by
httpd -l).   Modules should not be loaded ("LoadModule") if they are linked
statically, and conversely, DSO modules can not be added ("AddModule") if
they are not loaded (LoadModule).  

Perhaps a better directive would just be "EnableModule", so that a DSO
module would be both loaded and enabled and a statically linked  module
would not activated unless it was enabled ("EnableModule").  (I know this
sounds simple, and probably why it can't be implemented. :)






Re: Strange error in log: Attempt to free unreferenced scalar.

2000-08-14 Thread Wesley Darlington

Hi,

Doh! Forgot attachment. :-(

Wesley.


On Mon, Aug 14, 2000 at 11:35:53AM +0100, Wesley Darlington wrote:
> Hi,
> 
> On Mon, Aug 14, 2000 at 01:29:53PM +0400, Vladimir Buyanov wrote:
> > We don't use Apache::AuthDBI module, but use:
> 
> No, we don't use it either...
> 
> > use Mysql;
> > use HTML::Template;
> > use CGI;
> > use Mail::Mailer;
> > use Time::Local;
> > use Time::localtime;
> > use Net::SMTP;
> > use MIME::Base64;
> > use CGI::Cookie;
> 
> ...but we do use loads of modules. Attached is a list of pretty much
> all the nih modules preloaded in our apaches.
> 
> Thanks,
> Wesley.


   Package Version Modified File
   AnyDBM_File 0.00 Wed Sep 22 08:32:30 1999
   Apache 1.26 Sat Jun 5 04:16:08 1999
   Apache::Connection 1.00 Mon Feb 1 05:38:56 1999
   Apache::Constants 1.09 Thu Jan 28 01:13:42 1999
   Apache::Constants::Exports 0.00 Fri Nov 20 04:16:06 1998
   Apache::Registry 2.01 Wed Jan 13 02:56:34 1999
   Apache::Server 1.01 Mon Feb 1 05:38:59 1999
   Apache::Status 2.01 Tue Jun 29 06:07:22 1999
   Apache::Symbol 0.00 Mon Jan 18 04:31:11 1999
   Apache::Table 0.01 Mon Feb 1 05:39:00 1999
   Apache::URI 1.00 Mon Feb 1 05:39:01 1999
   AutoLoader 0.00 Wed Sep 22 08:32:30 1999
   B 0.00 Wed Sep 22 08:32:33 1999 /usr/lib/perl5/5.005/i386-linux/B.pm
   Business::CreditCard 0.00 Sat Jan 18 22:11:46 1997
   CCCheck 1.26 Wed Jun 7 11:30:07 2000 
   CGI 2.59 Mon May 15 19:21:24 2000 /usr/lib/perl5/CGI.pm
   CGI::Carp 1.16 Mon Mar 20 03:34:16 2000 /usr/lib/perl5/CGI/Carp.pm
   CGI::Cookie 1.16 Tue Mar 28 03:16:54 2000 /usr/lib/perl5/CGI/Cookie.pm
   CGI::Util 1.1 Wed Apr 12 19:02:25 2000 /usr/lib/perl5/CGI/Util.pm
   Carp 0.00 Wed Sep 22 08:32:30 1999 /usr/lib/perl5/5.005/Carp.pm
   Config 0.00 Wed Sep 22 08:34:46 1999 
   Crypt::Blowfish 0.00 Wed Aug 6 15:45:49 1997   
   Cwd 2.01 Wed Sep 22 08:32:30 1999 /usr/lib/perl5/5.005/Cwd.pm
   DBD::mysql 2.0409 Thu Nov 25 13:24:01 1999 
   DBI 1.13 Mon Jul 12 03:04:42 1999  
   Data::Dumper 2.101 Wed Sep 22 08:32:29 1999   
   DataCash::External 2.4.1g Mon Aug 23 15:29:37 1999  
   Date::Calc 4.2 Tue Sep 15 21:58:12 1998 
   Date::Manip 5.35 Tue Jul 6 17:31:00 1999
   DirHandle 0.00 Wed Sep 22 08:32:30 1999
   DynaLoader 1.03 Wed Sep 22 08:32:33 1999 
   Exporter 0.00 Wed Sep 22 08:32:30 1999
   Fcntl 1.03 Wed Sep 22 08:32:33 1999  
   File::Basename 2.6 Wed Sep 22 08:32:29 1999
   File::Find 0.00 Wed Sep 22 08:32:29 1999  
   File::Spec 0.6 Wed Sep 22 08:32:29 1999
   File::Spec::Unix 0.00 Wed Sep 22 08:32:29 1999
   FileHandle 2.00 Wed Sep 22 08:32:30 1999
   FreezeThaw 0.00 Mon Oct 14 11:53:04 1996  
   GD 1.19 Mon Apr 26 21:31:21 1999 
   IO 1.20 Fri Jul 24 04:52:41 1998 /usr/lib/perl5/5.005/i386-linux/IO.pm
   IO::File 1.08 Thu Apr 16 02:21:55 1998 
   IO::Handle 1.21 Fri Jul 24 04:30:00 1998 
   IO::Seekable 1.08 Thu Apr 16 02:13:14 1998   
   IO::Select 1.13 Fri Jul 24 04:45:41 1998   
   IO::Socket 1.25 Tue Jul 14 04:50:53 1998 
   IO::Socket::INET 1.24 Thu May 21 02:06:46 1998  
   IO::Socket::UNIX 1.20 Thu Mar 19 02:36:09 1998
   Image::Size 2.903 Fri Apr 28 03:56:13 2000  
   MIME::Base64 2.11 Sat Feb 27 20:40:04 1999   
   MIME::Lite 1.135 Sun Apr 18 15:32:13 1999   
   MIME::QuotedPrint 2.03 Tue Dec 2 10:24:27 1997
   Mysql 1.2208 Wed Oct 13 17:29:12 1999  
   Mysql::Statement 1.2208 Wed Oct 13 17:29:11 1999
   NDBM_File 1.01 Wed Sep 22 08:32:33 1999 
   Net::Cmd 2.16 Sat Sep 18 16:25:55 1999
   Net::Config 1.00 Fri Oct 16 00:38:31 1998 
   Net::SMTP 2.15 Fri Apr 2 17:05:42 1999   
   Number::Spell 0.04 Sat Mar 11 20:20:17 2000  
   POSIX 1.02 Wed Sep 22 08:32:33 1999
   SelectSaver 0.00 Wed Sep 22 08:32:30 1999
   Symbol 1.02 Wed Sep 22 08:32:30 1999 /usr/lib/perl5/5.005/Symbol.pm
   Tie::Hash 0.00 Wed Sep 22 08:32:30 1999 
   Tie::RefHash 0.00 Wed Sep 22 08:32:30 1999
   Time::HiRes 01.20 Tue Mar 16 02:28:20 1999
   URI::Escape 3.13 Sat Mar 20 07:43:40 1999
   integer 0.00 Wed Sep 22 08:32:30 1999 /usr/lib/perl5/5.005/integer.pm
   mod_perl 1.21 Sat Jul 3 00:33:50 1999 
   overload 0.00 Wed Sep 22 08:32:30 1999  
   re 0.02 Wed Sep 22 08:32:30 1999 /usr/lib/perl5/5.005/i386-linux/re.pm
   strict 1.01 Wed Sep 22 08:32:30 1999 /usr/lib/perl5/5.005/strict.pm
   vars 0.00 Wed Sep 22 08:32:30 1999 /usr/lib/perl5/5.005/vars.pm



Re: Exceptions section dropped?

2000-08-14 Thread Stas Bekman

Hi, Andreas

> > On Mon, 14 Aug 2000 10:04:33 +0200 (CEST), Stas Bekman <[EMAIL PROTECTED]> said:
> 
> cpan> install mod_perl_guide
>  > Running make for S/ST/STAS/Apache-mod_perl_guide-1.22.tar.gz
> 
>  > Got another SIGINT
> cpan> install Apache::mod_perl_guide
>  > Running make for S/ST/STAS/Apache-mod_perl_guide-1.23.tar.gz
> 
>  > ...while the latest version is 1.25. Something is wrong.
> 
>  > I won't delete the previous versions of the Guide now, so whoever handles
>  > CPAN now (I think it's Jarkko Hietaniemi) will be able to verify and debug
>  > this apparently broken behavior.
> 
> If you want to use CPAN.pm as a distribution medium for the guide, you
> need to be careful about versioning. You need to tell people which
> module (or pseudo module) they should install in order to get the
> guide and you should then make sure that this module always carries
> the latest version number.
> 
> You need to know that PAUSE is parsing the *.pm files in order ot
> guess the $VERSION.

I do know that.

> So when I look at 1.25, I find only one file that contains the
> $VERSION=1.25 and that is src/Version.pm. And that file does not have
> a package declaration, so PAUSE has no chance to guess which package
> is referred to.

That's my fault. I was confused by Makefile.PL's:
   VERSION_FROM => 'src/Version.pm',

> Note that PAUSE is parsing, not interpreting the code, so perl tricks
> do not work. You need to write pretty straightforward code.

Ok

> So, I hear you asking, "what should I do"? I believe that you should
> include the $VERSION=1.25 in your mod_perl_guide.pm where there is
> already a package declaration. If it doesn't work, let me know shortly
> after the upload, and I'll find a better suggestion.

I know what should I do:

src/Version.pm:
package Apache::mod_perl_guide;
$VERSION = '1.26';
1;

Does this look good?

At this point I'll solve it by removing the old versions from CPAN. And
starting from the next release this should be clean.

Thanks a lot, Andreas!!!

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org





RE: parsing SSI in cgi scripts?

2000-08-14 Thread Vladislav Safronov

> >Hi,
> >
> >Is there way for processing SSI commands in perl?
> >(my templates may contains SSI commands, so what
> >should I do - just type in real html or process them somehow?)
> 
> Check out Apache::SSI.  It can solve the problem.  Can be used with
> Apache::Filter or by instantiating an Apache::SSI object directly.
> 
Ok! Thanks!



Re: Strange error in log: Attempt to free unreferenced scalar.

2000-08-14 Thread Wesley Darlington

Hi,

On Mon, Aug 14, 2000 at 01:29:53PM +0400, Vladimir Buyanov wrote:
> We don't use Apache::AuthDBI module, but use:

No, we don't use it either...

> use Mysql;
> use HTML::Template;
> use CGI;
> use Mail::Mailer;
> use Time::Local;
> use Time::localtime;
> use Net::SMTP;
> use MIME::Base64;
> use CGI::Cookie;

...but we do use loads of modules. Attached is a list of pretty much
all the nih modules preloaded in our apaches.

Thanks,
Wesley.



RE: Problem with form data using mod_perl and CGI.pm

2000-08-14 Thread Bryan McGuire

"perldoc perlref" addresses the nested subroutine problem, and
suggests using something like this:

  local *printQueryParams = sub {

instead of this:

  sub printQueryParams {

The assignment to the typeglob is pretty slick in that it let's you
call the anonymous subroutine as if it were a subroutine named
printQueryParams.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 14, 2000 3:44 AM
To: Stas Bekman
Cc: Jie Gao; [EMAIL PROTECTED]
Subject: Re: Problem with form data using mod_perl and CGI.pm


Stas Bekman wrote:
>
> On Mon, 14 Aug 2000, stevenl wrote:
>
> > Thanks.  That seems to be the problem, accessing an outer lexical
> > variable in an inner subroutine.  I'm not quite sure I understand
why
> > Perl behaves this way.  Java seems to handle this just fine with
the
> > expected behavior.
>
> Because Perl != Java. And you are lucky that the last statement
> returns true :) Of course the real explanation would require some
reading
> from you.
>

I thought the whole philosophy behind Perl is that it does what you
expect it to do and this is in no way what anyone would expect it to
behave!

Thanks for the link.  I guess I'll read up on this guide more
carefully
before I ask any further questions.

-Steven



> > I'm currently using:
> >
> > use CGI;
> > my $query = new CGI();
> >
> > What is the best way to define a global value like $query if I
want to
> > 'use strict'.  I really don't want to be passing $query to all my
> > subroutines.  I could package define it as $main::query but that
seems
> > awkward.
>
>
http://perl.apache.org/guide/perl.html#Using_Global_Variables_and_Shar
i
>
> > -Steven
> >
> >
> > Jie Gao wrote:
> > >
> > > On Sat, 12 Aug 2000, stevenl wrote:
> > >
> > > > I am running Linux 2.2, Apache 1.3.12, mod_perl 1.24, and
CGI.pm 2.70.
> > > >
> > > > If I declare a CGI variable using 'my' (see below) and use
mod_perl, I
> > > > encounter problems with POST data.  On subsequent entries in
the form,
> > > > it continues to use the old data.
> > > >
> > > > The problem does not appear if I don't use 'my' (and
therefore, unable
> > > > to 'use strict'), or if I disable mod_perl from my httpd.conf
file.
> > > >
> > > > You can test this out with these files.  First, run
'httpd -X'.  Then
> > > > enter some data in the form.  On the next submit, the data is
not
> > > > changed.
> > > >
> > > > Note: The perl script displays the current HTML file plus what
you
> > > > just entered.
> > > > ...
> > >
> > >
http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
> > >
> > > Jie
> >
>
>
_
> Stas Bekman  JAm_pH --   Just Another mod_perl
Hacker
> http://stason.org/   mod_perl Guide
http://perl.apache.org/guide
> mailto:[EMAIL PROTECTED]   http://apachetoday.com
http://jazzvalley.com
> http://singlesheaven.com http://perlmonth.com   perl.org
apache.org




Re: mod_perl on a FreeBSD 3.5-STABLE

2000-08-14 Thread Marko van der Puil

Yep, this is most definitively what it is, the question is on how to fix it.
Install from scratch is my guess...


Sander van Zoest wrote:

> On Tue, 8 Aug 2000, Marko van der Puil wrote:
>
> > I done the installation by hand like in the guide, now my mod_perl is
> > fine, except cgi-s dont run from the prompt anymore exiting with...
> > --->>>error_log-
> > DynaLoader object version 1.04 does not match $DynaLoader::VERSION 1.03 at
> > /usr/libdata/perl/5.00503/DynaLoader.pm line 80.
> > BEGIN failed--compilation aborted at
> > /usr/local/lib/perl5/site_perl/5.005/i386-freebsd/DBI.pm line 149.
> > BEGIN failed--compilation aborted at ./dbtest.cgi line 2.
> > --->>>error_log-
> > If I use DBI.pm somewhere in a script. If I run the same script in RunPerl
> > it works ok Strange that... Any Id's anyone?
>
> This means there is probably a version of perl being picked up in your
> apache binary versus your perl being run on the commandline.
>
> That is what I would guess.
>
> Cheers,
>
> --
> Sander van Zoest [[EMAIL PROTECTED]]
> Covalent Technologies, Inc.  http://www.covalent.net
> (415) 536-5218

--
Yours sincerely,
Met vriendelijke groeten,


Marko van der Puil http://www.renesse.com
   [EMAIL PROTECTED]





Re: Strange error in log: Attempt to free unreferenced scalar.

2000-08-14 Thread Vladimir Buyanov

Hi!

We don't use Apache::AuthDBI module, but use:

use Mysql;
use HTML::Template;
use CGI;
use Mail::Mailer;
use Time::Local;
use Time::localtime;
use Net::SMTP;
use MIME::Base64;
use CGI::Cookie;

Sincerely yours,

Vladimir Buyanov, senior web-developer
Agama Internet Systems
http://www.aport.ru
http://www.agama.com


- Original Message - 
From: <[EMAIL PROTECTED]>
To: Wesley Darlington <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 14, 2000 1:07 PM
Subject: Re: Strange error in log: Attempt to free unreferenced scalar.


> On Fri, 11 Aug 2000, Wesley Darlington wrote:
> 
> Hi,
> 
> > > Attempt to free unreferenced scalar.
> > 
> > Yeah, we get those too. I don't know what they are either. *grin*
> > Running without perlfreshrestart/graceful-restarts seems to help, 
> > but this cure is worse than the disease - we just put up with the 
> > slight memory leaks associated with the occasional graceful restart 
> > and do a hard restart every week or two. It's only a minor niggle
> > and someday I'll sort it out!
> 
> I experience the same problem, but it seems to occur only when using
> Apache::AuthDBI. Any of you used it?
> 
> Remco
> 
> /--\
> | Remco Schaar |
> | e-mail: [EMAIL PROTECTED]  |
> \--/
> 
> South Park meets Linux:
> - "Oh my God, they killed init!"
> - "You bastards!"
> 
> 
> 




Re: Strange error in log: Attempt to free unreferenced scalar.

2000-08-14 Thread remco

On Fri, 11 Aug 2000, Wesley Darlington wrote:

Hi,

> > Attempt to free unreferenced scalar.
> 
> Yeah, we get those too. I don't know what they are either. *grin*
> Running without perlfreshrestart/graceful-restarts seems to help, 
> but this cure is worse than the disease - we just put up with the 
> slight memory leaks associated with the occasional graceful restart 
> and do a hard restart every week or two. It's only a minor niggle
> and someday I'll sort it out!

I experience the same problem, but it seems to occur only when using
Apache::AuthDBI. Any of you used it?

Remco

/--\
| Remco Schaar |
| e-mail: [EMAIL PROTECTED]  |
\--/

South Park meets Linux:
- "Oh my God, they killed init!"
- "You bastards!"





caching dynamic pages

2000-08-14 Thread Robert Friberg


Hi all,

I'm new to modperl but not perl, running a standard RH 6.0
with the modperl RPM off apache.org. I'm generating pages
from a mysql db which change maybe 3 times a week. The
expected traffic will be between 1000 and 1 hits 
per day. Obviously I would like to cache some of the
common pages and maybe some raw table data.

My question is where should I put the var and how do I access it? 
I don't want one copy for each child, so I should go for the
startup file, right?

tia,
--
robert friberg, ensofus ab
+46(0)708 98 57 01



Re: Exceptions section dropped?

2000-08-14 Thread Andreas J. Koenig

> On Mon, 14 Aug 2000 10:04:33 +0200 (CEST), Stas Bekman <[EMAIL PROTECTED]> said:

cpan> install mod_perl_guide
 > Running make for S/ST/STAS/Apache-mod_perl_guide-1.22.tar.gz

 > Got another SIGINT
cpan> install Apache::mod_perl_guide
 > Running make for S/ST/STAS/Apache-mod_perl_guide-1.23.tar.gz

 > ...while the latest version is 1.25. Something is wrong.

 > I won't delete the previous versions of the Guide now, so whoever handles
 > CPAN now (I think it's Jarkko Hietaniemi) will be able to verify and debug
 > this apparently broken behavior.


If you want to use CPAN.pm as a distribution medium for the guide, you
need to be careful about versioning. You need to tell people which
module (or pseudo module) they should install in order to get the
guide and you should then make sure that this module always carries
the latest version number.

You need to know that PAUSE is parsing the *.pm files in order ot
guess the $VERSION.

So when I look at 1.25, I find only one file that contains the
$VERSION=1.25 and that is src/Version.pm. And that file does not have
a package declaration, so PAUSE has no chance to guess which package
is referred to.

Note that PAUSE is parsing, not interpreting the code, so perl tricks
do not work. You need to write pretty straightforward code.

So, I hear you asking, "what should I do"? I believe that you should
include the $VERSION=1.25 in your mod_perl_guide.pm where there is
already a package declaration. If it doesn't work, let me know shortly
after the upload, and I'll find a better suggestion.

-- 
andreas



Re: Problem with form data using mod_perl and CGI.pm

2000-08-14 Thread stevenl

Stas Bekman wrote:
> 
> On Mon, 14 Aug 2000, stevenl wrote:
> 
> > Thanks.  That seems to be the problem, accessing an outer lexical
> > variable in an inner subroutine.  I'm not quite sure I understand why
> > Perl behaves this way.  Java seems to handle this just fine with the
> > expected behavior.
> 
> Because Perl != Java. And you are lucky that the last statement
> returns true :) Of course the real explanation would require some reading
> from you.
> 

I thought the whole philosophy behind Perl is that it does what you
expect it to do and this is in no way what anyone would expect it to
behave!

Thanks for the link.  I guess I'll read up on this guide more carefully
before I ask any further questions.

-Steven



> > I'm currently using:
> >
> > use CGI;
> > my $query = new CGI();
> >
> > What is the best way to define a global value like $query if I want to
> > 'use strict'.  I really don't want to be passing $query to all my
> > subroutines.  I could package define it as $main::query but that seems
> > awkward.
> 
> http://perl.apache.org/guide/perl.html#Using_Global_Variables_and_Shari
> 
> > -Steven
> >
> >
> > Jie Gao wrote:
> > >
> > > On Sat, 12 Aug 2000, stevenl wrote:
> > >
> > > > I am running Linux 2.2, Apache 1.3.12, mod_perl 1.24, and CGI.pm 2.70.
> > > >
> > > > If I declare a CGI variable using 'my' (see below) and use mod_perl, I
> > > > encounter problems with POST data.  On subsequent entries in the form,
> > > > it continues to use the old data.
> > > >
> > > > The problem does not appear if I don't use 'my' (and therefore, unable
> > > > to 'use strict'), or if I disable mod_perl from my httpd.conf file.
> > > >
> > > > You can test this out with these files.  First, run 'httpd -X'.  Then
> > > > enter some data in the form.  On the next submit, the data is not
> > > > changed.
> > > >
> > > > Note: The perl script displays the current HTML file plus what you
> > > > just entered.
> > > > ...
> > >
> > > http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
> > >
> > > Jie
> >
> 
> _
> Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
> http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
> mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
> http://singlesheaven.com http://perlmonth.com   perl.org   apache.org



Re: Problem with form data using mod_perl and CGI.pm

2000-08-14 Thread Stas Bekman

On Mon, 14 Aug 2000, stevenl wrote:

> Thanks.  That seems to be the problem, accessing an outer lexical
> variable in an inner subroutine.  I'm not quite sure I understand why
> Perl behaves this way.  Java seems to handle this just fine with the
> expected behavior.

Because Perl != Java. And you are lucky that the last statement
returns true :) Of course the real explanation would require some reading
from you.

> I'm currently using:
> 
> use CGI;
> my $query = new CGI();
> 
> What is the best way to define a global value like $query if I want to
> 'use strict'.  I really don't want to be passing $query to all my
> subroutines.  I could package define it as $main::query but that seems
> awkward.

http://perl.apache.org/guide/perl.html#Using_Global_Variables_and_Shari

> -Steven
> 
> 
> Jie Gao wrote:
> > 
> > On Sat, 12 Aug 2000, stevenl wrote:
> > 
> > > I am running Linux 2.2, Apache 1.3.12, mod_perl 1.24, and CGI.pm 2.70.
> > >
> > > If I declare a CGI variable using 'my' (see below) and use mod_perl, I
> > > encounter problems with POST data.  On subsequent entries in the form,
> > > it continues to use the old data.
> > >
> > > The problem does not appear if I don't use 'my' (and therefore, unable
> > > to 'use strict'), or if I disable mod_perl from my httpd.conf file.
> > >
> > > You can test this out with these files.  First, run 'httpd -X'.  Then
> > > enter some data in the form.  On the next submit, the data is not
> > > changed.
> > >
> > > Note: The perl script displays the current HTML file plus what you
> > > just entered.
> > > ...
> > 
> > http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
> > 
> > Jie
> 



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org





Re: Problem with form data using mod_perl and CGI.pm

2000-08-14 Thread stevenl

Thanks.  That seems to be the problem, accessing an outer lexical
variable in an inner subroutine.  I'm not quite sure I understand why
Perl behaves this way.  Java seems to handle this just fine with the
expected behavior.

I'm currently using:

use CGI;
my $query = new CGI();

What is the best way to define a global value like $query if I want to
'use strict'.  I really don't want to be passing $query to all my
subroutines.  I could package define it as $main::query but that seems
awkward.

-Steven


Jie Gao wrote:
> 
> On Sat, 12 Aug 2000, stevenl wrote:
> 
> > I am running Linux 2.2, Apache 1.3.12, mod_perl 1.24, and CGI.pm 2.70.
> >
> > If I declare a CGI variable using 'my' (see below) and use mod_perl, I
> > encounter problems with POST data.  On subsequent entries in the form,
> > it continues to use the old data.
> >
> > The problem does not appear if I don't use 'my' (and therefore, unable
> > to 'use strict'), or if I disable mod_perl from my httpd.conf file.
> >
> > You can test this out with these files.  First, run 'httpd -X'.  Then
> > enter some data in the form.  On the next submit, the data is not
> > changed.
> >
> > Note: The perl script displays the current HTML file plus what you
> > just entered.
> > ...
> 
> http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
> 
> Jie



Re: my transhandler runs only once in each child ?!?

2000-08-14 Thread Eric Cholet

> Dear All
> 
> I've a bug somewhere that I cannot appear to spot..
> 
> I have writen parts of a transhandler to handle session's.  It works in
> once in each child and then does not appear to be executed again.
> 
> I've looked through The Guide and could not see anything there, nor in
> the 'Apache modules in Perl and C'.  I must be missing somehing (a clue
> for a start ;-).
> 
> The obvious answer is that a variable is not being redefined /
> initialised.
> 
> Any ideas appreciated.
> 
> Greg Cope
> 
> ### some clues below (I hope)
> 
> I have these lines in my startup.pl:
> 
> use tinasm::Session();
> 
> $tinasm::Session::DEBUG = 1;
> $tinasm::Session::DIR_MATCH = 'test';
> $tinasm::Session::REDIRECT = 1;
> $tinasm::Session::USE_ENV = 1;
> 
> # end of startup.pl, snippet #
> 
> part of the module below
> 
> # code snippet #
> package tinasm::Session;
> 
> use strict;
> use Apache;
> use Apache::Constants qw(DECLINED REDIRECT OK);
> use Digest::MD5 qw(md5_hex);
> 
> use constant SESSION_ID_LENGTH => 8;
> 
> use vars qw($DIR_MATCH $COOKIES_ONLY $ARGS_ONLY 
> $DEBUG $REDIRECT $URI_FIRST $USE_ENV);
> 
> Apache->push_handlers("PerlTransHandler", \&transhandler);

this will trigger the handler for the first request. Nothing
will trigger it for subsequent requests. If you want it to run
for every request, why not just drop the push_handlers call
and add PerlTransHandler tinasm::Session to httpd.conf.

> 
> sub transhandler {
> 
> my $r = shift;
> unless ($r->uri =~ m!$DIR_MATCH!o) {
> print STDERR "SESSION-MANAGER-$$-URI not matched\n"
> if $DEBUG;
> return DECLINED;
> }
> 
> print STDERR "SESSION-MANAGER-$$-URI match\n" if $DEBUG;
> 
> . handler goes on for another 200 lines so I've snipped it - if
> anyone wants to look at it drop me a line.
 
--
Eric





Re: Exceptions section dropped?

2000-08-14 Thread Stas Bekman

On Mon, 14 Aug 2000, Matt Sergeant wrote:

> On Mon, 14 Aug 2000, Stas Bekman wrote:
> 
> > > I went to patch the exceptions section of the guide 1.22, and found it
> > > gone... Has it been dropped permanently or been misplaced?
> > 
> > Huh? It's all there, see:
> > http://perl.apache.org/guide/perl.html#Exception_Handling_for_mod_perl
> > 
> > Matt, the latest version is 1.25.
> 
> I knew something was up... 1.22 is the version that I got when CPAN.pm
> installed it. I'll try again.

Ok, you it looks like you've hit some CPAN bug, indeed:

i /guide/
DistributionS/ST/STAS/Apache-mod_perl_guide-1.22.tar.gz
DistributionS/ST/STAS/Apache-mod_perl_guide-1.23.tar.gz
istributionS/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz
Module  Apache::mod_perl_guide
(S/ST/STAS/Apache-mod_perl_guide-1.23.tar.gz)
Module  DB_File::Lock2
(S/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz)
Module  Guide::Pod2Html
(S/ST/STAS/Apache-mod_perl_guide-1.23.tar.gz)
Module  Guide::Pod2HtmlPS
(S/ST/STAS/Apache-mod_perl_guide-1.23.tar.gz)
Module  My::DB
(S/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz)
Module  Pod::HtmlPsPdf::Book
(S/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz)
Module  Pod::HtmlPsPdf::Chapter
(S/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz)
Module  Pod::HtmlPsPdf::Common
(S/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz)
Module  Pod::HtmlPsPdf::Config
(S/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz)
Module  Pod::HtmlPsPdf::Html
(S/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz)
Module  Pod::HtmlPsPdf::RunTime
(S/ST/STAS/Apache-mod_perl_guide-1.25.tar.gz)
Module  mod_perl_guide
(S/ST/STAS/Apache-mod_perl_guide-1.22.tar.gz)

cpan> install mod_perl_guide
Running make for S/ST/STAS/Apache-mod_perl_guide-1.22.tar.gz

Got another SIGINT
cpan> install Apache::mod_perl_guide
Running make for S/ST/STAS/Apache-mod_perl_guide-1.23.tar.gz

...while the latest version is 1.25. Something is wrong.

I won't delete the previous versions of the Guide now, so whoever handles
CPAN now (I think it's Jarkko Hietaniemi) will be able to verify and debug
this apparently broken behavior.

BTW, my CPAN client's version is 1.56

search.cpan.org returns a correct version (the latest):
http://search.cpan.org/search?mode=module&query=mod_perl_guide
So Matt please use this link for now.

Thanks a lot!

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org





Re: Exceptions section dropped?

2000-08-14 Thread Matt Sergeant

On Mon, 14 Aug 2000, Matt Sergeant wrote:

> > Matt, the latest version is 1.25.
> 
> I knew something was up... 1.22 is the version that I got when CPAN.pm
> installed it. I'll try again.

OK, again I typed in the CPAN shell:

install Apache-mod_perl_guide

And it tried to give me 1.22 again. Then I tried all sorts of ways of
adding 1.25 onto the end of that to no avail. The only way I managed to
get 1.25 installed by CPAN.pm was to type:

install My::DB

I seem to recall there was a better way via a Bundle:: or something, but I
can't recall what it was, and nothing showed up under "i /guide/".

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




Re: Exceptions section dropped?

2000-08-14 Thread Matt Sergeant

On Mon, 14 Aug 2000, Stas Bekman wrote:

> > I went to patch the exceptions section of the guide 1.22, and found it
> > gone... Has it been dropped permanently or been misplaced?
> 
> Huh? It's all there, see:
> http://perl.apache.org/guide/perl.html#Exception_Handling_for_mod_perl
> 
> Matt, the latest version is 1.25.

I knew something was up... 1.22 is the version that I got when CPAN.pm
installed it. I'll try again.

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




[ANNOUNCE] AxKit 0.98

2000-08-14 Thread Matt Sergeant

I realised I hadn't announced this here yet...

I've put out AxKit 0.98. This version should be a big improvement in
debugging for people who found that they couldn't get AxKit running
before. The addition of an AxDebugLevel option allows you to alter the
level of debugging provided and see what is going wrong. There is still
some issues with segfaults when running complex setups with XML::Parser
2.28 and 2.29 which I hope to fix soon. Generally there have been a number
of improvements to the caching system. The most important change for some
people has been the addition of AxOutputCharset and
AxGzipOutput. AxOutputCharset allows you to send out non-utf8 output, and
AxGzipOutput does the equivalent of Apache::GzipOutput - gzipping the
contents to browsers that support zipped encoding.

AxKit home page: http://axkit.org/
AxKit download : http://axkit.org/download/

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




Re: Exceptions section dropped?

2000-08-14 Thread Stas Bekman

> I went to patch the exceptions section of the guide 1.22, and found it
> gone... Has it been dropped permanently or been misplaced?

Huh? It's all there, see:
http://perl.apache.org/guide/perl.html#Exception_Handling_for_mod_perl

Matt, the latest version is 1.25.


_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org





Bug in Apache::ASP XMLSubs when an argument includes '>'-characters?

2000-08-14 Thread Henrik Tougaard

I have been trying to test the limits of the nice new XMLSub feature in
Apache::ASP, and seem to have discovered a bug.

With this simple .asp page I get an error:

 
[My XMLSubMatch is set to Fiks:\w+  - the name of the subroutine doesn't
matter]

It seems as if the '>' in the '' argument confuses the parser.
The compiled perl script is (reformatted for readability - somewhat -
everything
was on one line!):

package Fiks::Web; ;; 
sub Fiks::Web::_bruger_ht00_Fagsys_www_orgvalg_fejl_aspxINL {
 ;;  @_ = (); ;;
 no strict;;
 use vars qw($Application $Session $Response $Server $Request);;
 Fiks::test({  Start=>"'); ;  ;; }

The error is:
Can't find string terminator "'" anywhere before EOF at (eval 140) line 1,
 line 1.

Is this a (mis)feature or a parser bug?

Regards
Henrik Tougaard, [EMAIL PROTECTED]
Forbundet af Offentligt Ansatte, Copehagen, Denmark.



Redirects issues...

2000-08-14 Thread Trevor Phillips

I'm revisiting a routine I have which in the ContentHandler phase, redirects to
another URI (status 302). While redirecting, I'd like to also set a cookie.

The example in the Eagle Book is fairly straightforward - you set the content
type, set a Location header, then return REDIRECT. Expanding on this, I coded
the following routine:

sub handler
{
my $r = shift;
$r->content_type('text/html');
$r->header_out(URI=>$uri);
$r->header_out(Location=>$uri);
   
$r->header_out('Set-Cookie'=>CGI::Cookie->new(-name=>$CookieName,-value=>$CookieVal,-path=>'/'));
return REDIRECT;
}

I set the URI header as well, due to habit. Didn't there used to be a browser
which required URI instead of Location? Is it safe to only use Location??

However, in my output from the above, I don't see the URI heading, and I don't
see the cookie heading. So I came up with the following alternative:

sub handler
{
my $r = shift;
$r->status(302);
$r->content_type('text/html');
$r->header_out(URI=>$uri);
$r->header_out(Location=>$uri);
   
$r->header_out('Set-Cookie'=>CGI::Cookie->new(-name=>$CookieName,-value=>$CookieVal,-path=>'/'));
$r->send_http_header;
$r->print("Redirecting to $uri...\n");
return OK;
}

This works as I want; Gives all the headers, including the all-important
Cookie.

My query is, why didn't the first one work, and is the way I ended up doing it
the best way, or is there a neater solution?

-- 
. Trevor Phillips -   http://jurai.murdoch.edu.au/ . 
: CWIS Systems Administrator -   [EMAIL PROTECTED] : 
| IT Services   -   Murdoch University | 
 >--- Member of the #SAS# & #CFC# <
| On nights such as this, evil deeds are done. And good deeds, of /
| course. But mostly evil, on the whole. /
 \  -- (Terry Pratchett, Wyrd Sisters)  /