Re: Sticky pnotes with Apache::Registry

2003-01-05 Thread David Kaufman
John Heitmann [EMAIL PROTECTED] wrote ...
 Hello,

 I am seeing an issue where it appears that the contents of pnotes does
 not get destroyed when code is run inside of Apache::Registry. I first
 noticed this when I saw that connections to our db remained open after
 a request was finished (we store the dbi handle in pnotes for
 inter-request caching)
 [...]
 I can work around this particular instance of the problem pretty
 easily. We can use Apache::DBI and we will only ever have one
 connection sticking around (as it is now there is a connection per
 request which is pretty awful)...

yes, Apache::DBI is the preferred method of cachng/pooling db connections
efficiently.  I've used it on many large projects and have never experienced
the problem you're seeing.  in fact, i've avoided using pnotes after seeing
similar inconsistencies and reading reports of others having them, too.
that was a while back, though.

sorry i can't offer more specific advise on pnotes (beyond don't rely on
pnotes), but maybe Apache::Session (or CGI::Session) can handle these
needs?

-dave







Re: File Upload Questions

2002-11-14 Thread David Kaufman
Dennis Daupert [EMAIL PROTECTED] wrote:

 I have gotten file upload working using Apache::Request for
 text files. But binary files seem to have other ideas :-)

 For example, uploading a word doc, I get a success message,
 but when I retrieve the doc after uploading it, and try to open it in
 Word 2000, I get the popup error message:

 The document name or path is not valid... etc [...]

 In case I have done something silly in my code, [...]

you may have done one silly thing :-)

 my $fh = $upload-fh;
 my @file = $fh;

here you slurp the lines of the text file into the @file array

 print WRITEFILE @file;

and here you put the @file array into double-quotes.  normal string
interpolation of an array is to join together the elements of the array,
separated by a *space*.  this is not what you wanted to do.

for instance, this code:

@a=('a','b','c');
print @a;

prints: a b c instead of abc

while:

@a=('a','b','c');
print @a;

prints: abc

so you should try:

  print WRITEFILE @file;  # without the quotes


instead and see if that works.

hth,

-dave




Re: okay, I give, I'm stumped

2002-07-28 Thread David Kaufman

Greg Rumple [EMAIL PROTECTED] wrote:

 The test.pl script works fine by it's self.  Turning on full PERL
 debugging/tracing yields that the actual script has fully finished, and
 that it's in the tear down of the actualy perl stuff that this failure
 is coming from.   Not from the script per se.  But it is the script that
 is causing this problem.  Commenting out the connect and disconnect
 lines causes the server to startup and function just fine.

conf snippage; test.pl containing:

 BEGIN {
 unshift(@INC, qw(
 /home/grumple/src/test/lib/perl5
 /home/grumple/src/test/system/lib/perl5
 ));
 }

did you intend that this BEGIN block only execute at server-start time, not
for each script execution?  if not, you might try replacing this with:

use lib qw(
  /home/grumple/src/test/lib/perl5
  /home/grumple/src/test/system/lib/perl5
);

 use DBI;

again, just a shot in the dark, but why not try the more mod_perl specific
Apache::DBI instead of plain ole DBI?

 use DBD::Informix;

i don't think you need this use statement at all.  the DBI-connect() call
should load the correct DBD Driver, for you, not that it *should* make any
difference... but hey.

 ## informix connection params
 $ENV{'INFORMIXDIR'}||= '/opt/informix';
 $ENV{'INFORMIXSERVER'} ||= 'test_tcp';
 $ENV{'LD_LIBRARY_PATH'} .= :$ENV{'INFORMIXDIR'}/lib;

 my $catalog = 'test';
 my $constr = join(':', 'dbi', 'Informix', $catalog);
 my $user = 'test';
 my $password = 'test';

 my $dbh = DBI-connect($constr,$user,$password);

i would certainly suggest adding:

or die DBI::errstr;

to that connect() call!

 $dbh-disconnect();

um, okay but why disconnect at all, if you know the segfault is caused by
the connect and/or disconnect calls? have you tries simply *not*
disconnecting?  one of The Features/Advantages of Apache::DBI (over plain
ole DBI) is that disconnect calls simlpy destroy the connection *object*
(the perl data structure) without actually disconnecting from the DB, and
therby maintaining a pool of cached connections, and therby speeding things
up nicely.





Re: ANNOUNCE: the new perl.apache.org is alive now!

2002-07-12 Thread David Kaufman

Stas Bekman [EMAIL PROTECTED] wrote:

 As you may know, the work on the new mod_perl site started in
 September 2001, and after almost a year we are glad to present to you
 the outcome of this work at the expected location:

http://perl.apache.org/

fist, let me say: Great Job!  the new site looks fantastic, a *vast* and
long-awaited improvement.

i still notice, however that the *content* of the Sites Running mod_perl
page doesn't seem to have been updated.  about 6 months ago, i sent notices
about two sites that we (Vanguard Media) had launched to the email address
that used to be on that page, but they were never included.

is this being actively maintained now?  should i re-send now to the docs-dev
mailing list?

thanks and, again, Great Work!

-dave




Re: ANNOUNCE: the new perl.apache.org is alive now!

2002-07-12 Thread David Kaufman

Matt Sergeant [EMAIL PROTECTED] wrote:

 On Fri, 12 Jul 2002, David Kaufman wrote:

  i still notice, however that the *content* of the Sites Running
mod_perl
  page doesn't seem to have been updated.  about 6 months ago, i sent
notices
  about two sites that we (Vanguard Media) had launched to the email
address
  that used to be on that page, but they were never included.

 Are there that many sites any more that are running pure mod_perl? I would
 expect most new sites to be running one of the framework modules -
 EmbPerl, TT, Mason, AxKit, ASP, etc... Perhaps live sites is a more
 framework specific thing (for example AxKit has its own list).

i guess the answer depends on your definition of pure mod_perl.  our sites
are developed using CGI::Application and HTML::Template, which might be
called a framework, a toolset or a swiss army knife :-)  but the server
headers say:

~ lynx -head -dump http://www.pageaday.com
HTTP/1.0 200 OK
Date: Fri, 12 Jul 2002 20:24:46 GMT
Server: Apache/1.3.20 (Unix) mod_perl/1.25

and

~ lynx -head -dump http://www.asiasociety.org
HTTP/1.1 200 OK
Date: Fri, 12 Jul 2002 21:58:23 GMT
Server: Apache/1.3.24 (Unix) mod_perl/1.25 mod_ssl/2.8.8 OpenSSL/0.9.6c

so, yes i consider them pure mod_perl sites though the code is not *pure*
native mod_perl handler code.  CGI::App's run faster under mod_perl in
Registry mode, but they also can be run (unmodified, if designed that way)
as CGI's.

do AxKit, Embperl, or Mason advertise themselves in the server signature?
can sites developed using all of these frameworks not also be said to be
running mod_perl?

perhaps the question should be: can sites developed on these frameworks run
*without* mod_perl?

-dave




What's in a name? (was: Re: [ANNOUNCE] The New mod_perl logo - results now in...)

2002-03-15 Thread David Kaufman

Georgy Vladimirov [EMAIL PROTECTED] wrote:

 I actually like the logo without the underscore. I don't think an
 underscore is very collaborative with art. The _ has always been
 irritating me a little.

 I know that there is history and nostalgia involved here but dropping
 an underscore at least in the logo is a nice evolution IMHO. The whole
 mod_ just happens to be the original Apache naming convention

i agree.

mod_perl looks like more like a variable name than a technology, much less
a *brand*.  it has a certain coolness factor all it's own, but the coolness
is lost on anyone who isn't a programmer, or more specifically, a mod_perl
programmer!  it just inspires more questions than answers.

i cannot tell you how many times i've told someone i was a mod_perl
programmer and then watched as the eyes of my prospective employer glazed
over as they apparently thought, a what programmer?  is that like a
computer programmer?  okay maybe i wouldn't  have been happy working for
those folks anyway, but sometimes you'd be happy working for any folks and
*those* are the times we wish mod_perl had a glossier finish, more brand
recognition, maybe some buzz in some business magazines and, you know, the
fame that it deserves.

i'm sure that many business executives who have very immediate problems that
mod_perl (and a mod_perl programmer) could easily solve read (what little
there is) in the press about mod_perl and wonder, how does one pronounce
this?  mod-underscore-perl?  what does *mod* mean?  if it was an acronym
they could at least investigate what the letters stood for, and then look up
those words.  but mod_ just seems to be whimsically short
for... --something.  modified perl?  modern perl?  is it pronounced moad
maybe?  is it modal?  it's an apache thing?  well, why didn't you *say* so?
(apache gets a pretty good amount of buzz, even out there in the
non-programmer world, for an open-source technology).

some other webserver-specific language API names are easier to fathom.  some
are even easier to pronounce.  ISAPI is easily spoken and easy to fathom
(once one knows what the letters stand for) if not so easy to afford.  NSAPI
is similarly fathomable.  a CEO can even find out what CGI is, without
having to embarrass themselves by asking a geek.

so why do we cling to mod_perl as a name?  i suppose for the familiar
historical reasons, it's a fond term of endearment to us.  but it would be
more descriptive to call it The Apache perl API or Apache-Embedded perl,
would it not?  it behooves us to ride along on Apache's name-recognition
doesn't it?

mod_perl, as a name simply does not do justice to the most powerfule and
popular programming language on Earth, embedded into the most powerful and
popular webserver on Earth, does it?  no, of course not.  so i say we ditch
the new logo (though i did vote for it and do like it a lot, sans_underscore
and all) and propose that we change the name summarily and forthwith TO:
(drum roll, please...)

The Apache-perl API

(or tApAPI for short)  it's pronounceable, alliterative, memorable and
hey, it almost rhymes with Apache!  ok, and slap-happy.  well either that or
Grape Apey, but let's not go there.

what more could anyone want in a name?

-dave





just launched, powered by mod_perl

2002-01-10 Thread David Kaufman

Page-a-Day® Online Calendars: http://www.pageaday.com/

The online version of Workman Publishing's famous boxed Page-a-Day desk
calendars is now powered by Apache/1.3.20 (Unix) mod_perl/1.25, MySQL 3.23
and IBM Linux servers.

Each printed calendar (available in thousands of bookstores and gift shops
nationwide) contains a unique Page-A-Day Online I.D. code in the back which
can be used to sign up for a free Online Calendar from www.pageaday.com.

The new 2002 online calendars, replacing the 2001 downloadable (win32
application) calendars, went online January 1st, and since then (8 days)
over 10,000 users have signed up and redeemed their I.D. codes to use online
calendar.  The response was so overwhelming that current bandwidth
limitations are red-lined and we're now waiting on a telco upgrade to the
dedicated T1 circuit.

David Kaufman [EMAIL PROTECTED]
Vanguard Media Corp
(212) 242-5317 Ext 125




Re: Perl and Microsoft Excel?

2001-11-29 Thread David Kaufman

Tom Servo [EMAIL PROTECTED] wrote:
 On Thu, 29 Nov 2001, Ian wrote:
  The campus phone system has a 911 database that is in Microsoft Excel
  format, and they want to be able to take that information, and show
  it on a webpage, either via a search form, or in one big table.  The
  problem is, they want to do it dynamically...the web server needs to
  yank it down from a samba share (or ftp), parse it, show it, and
  terminate.

 [...]
 Hopefully someone else knows of a CPAN module to work with Excel files,
 though...

i count at least 5:
http://search.cpan.org/search?mode=modulequery=Excel

i haven't used any of them, though.  i've used Spreadsheet::WriteExcel, but
it only *writes* Excel files, it doesn't read them (hence the name).

it looks like
Spreadsheet::ParseExcel
http://search.cpan.org/search?dist=Spreadsheet-ParseExcel

or Spreadsheet::ParseExcel::Simple
http://search.cpan.org/search?dist=Spreadsheet-ParseExcel-Simple

should do what you're looking for

hth,

-dave




Re: [OT] P2EE Redux was: Excellent article on Apache/mod_perl at eToys

2001-10-23 Thread David Kaufman

Robert Landrum [EMAIL PROTECTED] wrote:
 ... A name is pretty important
 and if it's acronym isn't easily recognized, it isn't going to gain
 the support of developers.  J2EE is catchy, so we need something
 catchy.  PEF isn't nearly as catchy as P2EE or P5EE or PEA (Perl
 Enterprise API), but maybe I'm just crazy.

howsabout: p5ice ?

   Perl 5 Integrated Classes for the Enterprise
or mebbe: Interface Client for Enterprises
possibly: Insane Community of Entrepeneurs
 or even: Icky Commercialized Edition

i can already see all the cool Ice-ey perl logos with icicles hanging from
their frosted fonts :-)

-dave






Re: [OT] ideas on design of a diff monitor

2001-05-13 Thread David Kaufman


Nick Tonkin [EMAIL PROTECTED] wrote:

 I'm working on a tool that should compare two versions of a file (usually,
 a web page) and report the _number_ of changes from one to the other...

well, the number of changes is a human concept; the number of
differences is only thing a program can calculate, and may or may not be
the same thing in a given circumstance.

cvs addresses this elegantly.  when your change the file in the human sense,
(or a set of differences with a single logical purpose) your number of
differences are committed as a single revision, with an attached log
message which you must supply, i.e. changed the title, heading h1 and
copyright notice at the bottom to reflect new site name -- several
differences bound together by the single purpose for the change.

 With Algorithm::Diff the output appears to be too granular: if I add five
 words onto a sentence it counts five changes, when it surely is only one
 ...
 And diff combines all changes on one line into one, afaics ...

Araxis Merge is like that - unlike cvs/rcs it highlights differences at the
character level, not the line level.  sometimes it's hand but also often
anooying...

it also has a great interface that clearly reports the number of
differences and lets you navigate to the first, previous, next and last
difference easily.

 Has anyone tackled this issue before?

i'll second the recommendation that you get more familiar with cvs.  used
properly, it will help you keep on top of what was changed, as well as when
and why :-)

-dave




Re: (beginner) Win32 installation / Writing Apache Modules in Perl C

2001-02-19 Thread David Kaufman

"Randy Kobes" [EMAIL PROTECTED] wrote:

 http://perl.apache.org/distributions.html contains links to how to
 install mod_perl via ActivePerl's ppm (Perl Package Manager), as
 well as some other Apache::* modules. For starting out on Win32 this route
 is probably the easiest, as everything you need to get started
 comes with the ppm distribution.

hmmm.  Randy, I'm running your *other* mod_perl binary distribution (linked
on the same page)
ftp://theoryx5.uwinnipeg.ca/pub/other/perl-win32-bin-0.6.exe because after
reading the readmes, it seemed the easiest to get up and runnig with:

  no setup/install program routine
  just unzip into the directories specified in the readme,
  edit autoexec.bat for path and variables, as specified
  edit conf files to taste, and
  voila!  perl 5.6, apache and ssl!

what could be easier?

also, besides replacing (and not playing nice with) ActiveState perl, are
there any other particular advantages or drawbacks between this distribution
and the AS-compatible ppm packages available from theoryx5uwinnipeg.ca site?
is one or the other more recent, or better maintained? which do you prefer
personally?

the readme.txt mentions:
"If you do not intend to run mod_perl, then you should consider
using ActiveState's perl (http://www.activestate.com/), which is more
widely used and supported."

i'd guess most here (including the originator of this thread) do intend to
run mod_perl, so is this statement in the readme.txt no longer relevant?

i happily blew away my Activestate perl installation to install your perl
build with this distribution (AS was really huge and seemed a bit bloated),
but recently realized i'll need AS back if i want to play with their Komodo
(sp?) perl IDE...

tia for your thoughts on this,

-dave