knows the ipchains or LVS stuff it can save you some
time and trouble.
- Perrin
.
And ++ on Paul's comments about Devel::DProf and other profilers.
- Perrin
scaling *TCP/IP*! I would say
their experience is not typical.
- Perrin
/ctoperl.html
- Perrin
is a nice little thing we
should
put up in CPAN. We've just not done so yet.
How does it differ from the other solutions like Cache::FileCache? Is it
something you could add to an existing module?
- Perrin
server
or the way you access it.
CPU utilization may not be all that telling, since database stuff often
takes the longest but doesn't burn much CPU.
- Perrin
{'MOD_PERL'}, you'll still
be able to run the script safely under standard CGI.
It also looks like you're re-inventing Apache::Filter or
Apache::OutputChain. Have you tried them?
- Perrin
if your connecion
parameters (user, login, etc.) are exactly the same. If different clients
connect to different databases, this should be fine. You won't accidentally
get the wrong one.
As for filehandles, I suggest you use lexically scoped ones if possible.
- Perrin
others have described.
- Perrin
What is mod_perl?
An Apache module.
An embedded Perl interpreter.
Fast.
Flexible.
What's wrong with CGI?
Forking Perl on every request.
Compiling the script every time.
Opening a new database connection every time.
Apache::DBI
it a scope option for each variable that determines if it's process or
request scope. In fact you could add support for some kind of data-sharing
and offer a server scope as well.
- Perrin
, but not shared
between multiple Apache processes. If you take requests for different
applications that need different singletons on the same Apache process, you
should separate them by namespace so they don't collide.
- Perrin
environment if I can avoid it, so I prefer to use a separate registry
approach that keeps $r-pnotes() out of my classes. It's also nice to be
able to quickly adapt other people's classes in this way without changing
their code to use Class::Singleton.
- Perrin
One thing I don't quite
understand is the need to clear out a singleton. Why would a
singleton need to hold transient state?
It's good for holding something request-specific, like a user session.
, if that
interests anyone).
That's a good idea. I've done similar things with accessor methods instead
of tied scalars.
- Perrin
Like this? (using register_cleanup instead of pnotes)
Better to use pnotes. I started out doing this kind of thing with
register_cleanup and had problems like random segfaults. I think it was
because other cleanup handlers sometimes needed access to these resources.
- Perrin
By the way, is there a perl module to do calculations with money?
There's Math::Currency.
- Perrin
/.
You could use mod_macro (or Perl sections) to avoid all the duplicated
typing.
- Perrin
to open my eyes?
http://mathforum.org/epigone/modperl/liphortwa/Pine.LNX.4.10.9909211217510.5
[EMAIL PROTECTED]
It's called current_callback().
- Perrin
I have the book but I don't always have it with
me.
That chapter is actually available for free on-line at
http://www.modperl.com/.
- Perrin
execution.
3rd. my sql queries are not the most optimized and mostly tossed
together.
DBIx::Profile can help you identify problems in your queries. And follow
the optimization advice for DBI in the guide.
- Perrin
data
sharing that showed the top performers to be Cache::Mmap and IPC::MM.
Cache::Cache and MLDBM::Sync should be more than fast enough for all but the
most highly optimized systems.
- Perrin
As far as the cacheing goes, we have had extremely good luck with
IPC::ShareLite used to share info across mod_perl processes.
IPC::ShareLite is not as fast as some of the other options, especially when
dealing with a large data set. The disk-based options tend to be faster.
- Perrin
Does anybody know a template engine, whose templates can be edited with a
WYSIWYG editor (favourably dreamweaver) as they will look when filled
with example data?
HTML_Tree: http://homepage.mac.com/pauljlucas/software/html_tree/
on.
- Perrin
around, because
transmogrify() now has a private copy of it.
- Perrin
(although segfaulting is clearly not reasonable
behavior even so).
- Perrin
for these files, but you also have
to tell it to load the module. Put in PerlModule Apache::PerlRun before
your Files section as directed by Stas and the PerlRun documentation.
- Perrin
DBI() in startup.pl as well as
the
PerlModule Apache::DBI in httpd.conf?
You need to use both Apache::DBI and DBI somewhere. Either place is fine.
I usually pull in lots of modules, so it's easier to do in startup.pl.
- Perrin
what you're trying to accomplish by calling
CGI methods during initialization, someone could suggest an alternative
way to do it.
- Perrin
.
Okay, I suspect the problem is that whenever you get a new request the setup
you did for CGI.pm gets cleared. You should store the static data in a
global, and then populate the CGI widget with it on every request.
- Perrin
has anybody any ideas?
Apache::Resource.
for it?
- Perrin
.
- Perrin
reports in the archives that describe the same thing.
And my suggestion for dealing with that in the short term is to change your
PerlModule directives to use Module; inside startup.pl or Perl sections.
- Perrin
to Java.
It's all applicable to mod_perl though.
- Perrin
as on unix, but definitely a speed-up.
- Perrin
something more like this:
Alias /perl-bin/ c:/IndigoPerl//perl-bin/
PerlModule Apache::Registry
Location /perl-bin
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
/Location
Not sure if you need PerlSendHeader or not. It depends on your code.
- Perrin
.
- Perrin
mailer script. I'm open to any suggestions.
- Perrin
to.
- Perrin
.
There are already commercial Perl IDEs (aimed at CGI mostly) that have some
code generation support and a set of pre-built components. Maybe looking at
those would help to gauge developer demand for this kind of thing.
- Perrin
assumptions about the way to cache the
content. Personally, I prefer to make this kind of thing an AccessHandler
rather than using Apache::Filter, but your approach makes sense for you
method of caching.
- Perrin
mysteriously ran out of data halfway through reading
from it. Does anybody have any idea what's going on here.
No, but it doesn't obviously point to problems with closures and lexical
scoping in my opinion. It looks more like you have a problem with that
filehandle.
- Perrin
if it improves
thing for you. There are plenty of other modules you can use to parse POST
data.
- Perrin
Well all my modules are written in Perl. When you say some C code you mean
the C code in DBI, or CGI or Template, don't you?
Yes. That's why I suggest trying Template with the Perl stash instead of
the XS one.
- Perrin
?
- Perrin
a bit more foolproof.
- Perrin
, is it?
- Perrin
, clean up resources, or print a useful error message.
- Perrin
code is not working :) - yah both of them
are
written in C .
Apache::ePerl is written in perl. It calls Parse::ePerl to do the dirty
work, and some of that is written in C, but not the part that's causing
you problems.
- Perrin
($stack))[3];
$stack++ ) {
$in_eval = 1 if $sub =~ /^\(eval\)/;
}
$error .= $_[0] unless $in_eval;
};
This is a slight variation of some Michael Schwern code that Stas posted
a little while ago.
- Perrin
handler to do this after
disconnecting form the client. See the guide for more details:
http://perl.apache.org/guide/performance.html#Forking_and_Executing_Subp
rocess
- Perrin
this script, and start that server as the proper user.
- Perrin
, or use a
templating tool that defaults to HTML-escaping all printed variables. If
you're doing this, nothing the user sends in will pose a CSS threat.
- Perrin
.
Does anyone know if Apache::Util::escape_html() and HTML::Entities::encode()
are safe?
- Perrin
://perl.apache.org/guide/porting.html#Name_collisions_with_Modules_and
- Perrin
with this particular regex which was fixed in a later version.
- Perrin
to be in a
position where you don't need to cache to improve performance. Caching adds
a lot of complexity and causes problems that are hard to explain to
non-technical people. However, for many of us caching is a necessity for
decent performance.
- Perrin
Perrin Harkins writes:
To fix this, we moved to not generating anything until it was requested.
We
would fetch the data the first time it was asked for, and then cache it
for
future requests. (I think this corresponds to your option 2.) Of
course
then you have to decide on a cache
passing references, slurping files, etc. pays off in better scalability
later.
- Perrin
There are many web testers out there. To put it bluntly, they don't
let you write maintainable test suites. The key to maintainability is
being able to define your own domain specific language.
Have you tried webchat? You can find webchatpp on CPAN.
to hear them.
- Perrin
that to the guide after I finish it.
- Perrin
than query
indexed table even on every request for password and departments where
user works.
It's generally fast enough, since it's a single row retrieved by ID. MySQL
is very fast at this kind of thing though.
- Perrin
Cache::FileBackend should use File::Path::mkpath for portability.
- Perrin
to mod_perl. I don't know if IIS
knows how to do this or not, but there's probably something available for NT
that does it.
- Perrin
PerlEx and FastCGI.
- Perrin
CGI.pm to notice. It isn't that he's
getting nothing from CGI.pm; it's that he's getting the same thing both
times. At least that's how I interpreted it.
- Perrin
I think the problem here is that mod_perl sets the assbackward flag
when setting headers via send_cgi_header() (which CGI.pm does).
Is this only an issue when using CGI.pm or PerlSendHeader then? I seem to
recall having no trouble doing this from a normal handler.
- Perrin
namespace and
one UNIVERSAL package. If you try to create two different versions of the
sub UNIVERSAL::foo() it won't work: there can be only one. This is true for
any package name, actually. If you need separate subs, name them
differently or put them in separate packagaes.
- Perrin
issue, not a mod_perl one.
- Perrin
a bunch of different processes running. Some of them hit the
forums first, and some hit the portal first. Last one wins.
- Perrin
and then a second set of headers with an error code
and it looks like garbage in a browser.
- Perrin
people's path
through the site and similar things. Often this is done for pages that
don't actually retrieve the session data from the backend store. Being able
to verify that you have a valid session without hitting your data store can
be very useful.
- Perrin
).
You could be having problems with a proxy on their end, but most proxies are
smart about this stuff.
- Perrin
have some
module doing something with XS or sockets or filehandles that can't deal
with being forked.
- Perrin
random.
There is this nagging fact that the parties involved are from the same
ISP's i.e. user A1 and A2 are
from foo.com, user B1 and B2 are from bar.com, etc.
You aren't using IP or domain as part of your ID generation, are you? That
would be bad.
- Perrin
So, is there an alternative - a module that will take an image
(gif/jpeg) and generate a thumbnail from it?
The GD module seems like a good candidate. There's also the Gimp
modules.
- Perrin
, and not much else in the session.
Actually, even this stuff could be put into a normalized sessions table
rather than serialized to a blob with Storable. It just means more work if
you ever change what's stored in the session.
- Perrin
with a message
digest. The only difference is that by sticking it in a form element you're
attaching it to a specific page.
- Perrin
I built and use a module that encodes a session hash into a number of
hidden
fields with a security MD5 sum.
Sounds a lot like CGI::SecureState. Have you ever looked at it?
- Perrin
as the user
opens two windows, it's absolute mayhem.
- Perrin
this
with Mason.
- Perrin
engine from your controller to render the view.
- Perrin
.
So my problem must come from the $r-notes(). Apparently it messes up with the
POST parameters.
That seems pretty unlikely. Are you sure you're not trying to read the
POST content twice? Maybe you're using a module that reads it?
- Perrin
A.C.Sekhar wrote:
How can I maintain the connections in perl?
Which connections? Connections to a database? A web browser?
Something else?
- Perrin
something with it, apache doesn't work that
way. Apache 2.0 does, but that won't help you right now. You might try
using a proxy server setup to do this instead.
- Perrin
to see what's out there.
- Perrin
Nico Erfurth wrote:
your handler could tie the output-handle (is this possible?) and run a
subrequest.
Nope, not possible. You can only do that for mod_perl requests.
- Perrin
, which kills our load
You should use Apache::SizeLimit and Apache::Resource to handle this
- Perrin
that resets STDOUT This is a similar concept to the
rollback that Apache::DBI issues in a cleanup handler
- Perrin
might have to actually build apache, or at least run
its configuration scipt It probably needs to set up OS-dependent files
- Perrin
where / is handled as a special case
Or maybe it's because there is no actual document there? Maybe
installing a transhandler would help
PerlTransHandler Apache::OK
But this is just a stab in the dark really
- Perrin
trace output, you can use this technique On the other hand,
your debugging may require seeing trace from every active process in
which case this won't help
- Perrin
effective, and provided almost exactly the same thing
that Interwoven sells Interwoven does add some workflow tools, but
most people I've talked to don't seem to use them Maybe if they did
get used that would provide more value
- Perrin
and no source, you should be fine to replace everything they
gave you if you want to. I wouldn't bother though, unless it's giving
you trouble.
- Perrin
the customer threw it out and went for a competing
technology. You must have been thinking of something else for that part.
- Perrin
Kurt Hansen wrote:
What I really want to know is: what ever happened to that eToys jingle that was on
the commercials?
That song is by Hawaiian performer Israel Kamakawiwo`ole. Here's a link
to the CD:
http://album.yahoo.com/shop?d=haid=1804600529cf=10intl=us
- Perrin
are much simpler
than those describing how something can be fetched. I would think it
makes more sense to do something along the lines of the Memoize module,
i.e. make it easy to add caching to your existing data fetching modules
(hopefully using a standard interface like Cache::Cache).
- Perrin
easilly to any pure virtual
function.
- Perrin
601 - 700 of 1298 matches
Mail list logo