Re: [mp2]: Is there a package for Debian/testing?

2003-01-24 Thread Mark Fowler
On Thu, 23 Jan 2003, Joachim Zobel wrote:

 So I would like to have a debian package. I found one in debian
 unstable, but this requires perl 5.8.

The perl in debian unstable is also 5.8.0, so this makes sense.  I've been
running it fine for months, so I highly recommend you install this on
your test box as well and see how it goes.

Of course, this will break any binary module you yourself installed
(though the ones you installed through the debian package system should
automatically upgrade themeselves too)

Mark.

-- 
#!/usr/bin/perl -T
use strict;
use warnings;
print q{Mark Fowler, [EMAIL PROTECTED], http://twoshortplanks.com/};



Re: development techniques

2003-01-10 Thread Mark Fowler
On Thu, 9 Jan 2003, Jim Martinez wrote:

 Is there some way to improve this cycle : edit code - refresh browser -
 possibly look at the error log - edit code - ...

No one seems to have mentioned WWW::Mechanize (or if they have I've missed
it.)  It's a simple module that allows you to interact with LWP like it's
a web browser (i.e. click on that link, enter these values into the form,
etc) abstracting away the actual parsing of the HTML.

Links:
  http://www.perladvent.org/2002/16th/
  http://search.cpan.org/author/PETDANCE/WWW-Mechanize/lib/WWW/Mechanize.pm

It's quite easy to integrate this with a test suite.  You can start doing
things like:

  #!/usr/bin/perl

  # turn on the safety features
  use strict;
  use warnings;

  # declare three tests
  use Test::More tests = 3;

  # create a new web browser
  use WWW::Mechanize;
  my $browser = WWW::Mechanize-new();

  # see if we can get the front page of search.cpan.org
  $browser-get(http://search.cpan.org/;);
  ok($browser-{res}-is_success, search.cpan.org);

  # see if we can get a search page back
  $browser-form(1);
  $browser-field(query,Acme::Buffy);
  $browser-click();
  ok($browser-{res}-is_success, module listing back);

  # something that will fail
  $browser-get(http://2shortplanks.com/nosuchurl;);
  ok($browser-{res}-is_success, no such url);

This prints out:

  1..3
  ok 1 - search.cpan.org
  ok 2 - module listing back
  not ok 3 - no such url
  # Failed test (test.pl at line 26)
  # Looks like you failed 1 tests of 3.

Hope that helps.

Mark.

-- 
#!/usr/bin/perl -T
use strict;
use warnings;
print q{Mark Fowler, [EMAIL PROTECTED], http://twoshortplanks.com/};



Re: Obfusacating the source

2002-11-19 Thread Mark Fowler

 I need some tool that gets all the perl modules and
 mason components, of an application we made, and obfucaste
 it a little.

See Acme::Bleach

http://search.cpan.org/author/DCONWAY/Acme-Bleach/lib/Acme/Bleach.pm

It works by source filtering and encoding the source as whitespace chars.

(see also Acme::Bleach, Acme::Pony...)

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Nearing banner submission deadline

2002-07-02 Thread Mark Fowler

On Tue, 2 Jul 2002, Per Einar Ellefsen wrote:

 Banners are now online!!
 
 We received banners from 3 persons, and they will all represent mod_perl :) 
 However, if you have any new ideas and a little time, you are very welcome 
 to send in more banners, we always welcome those.
 
 See the banners online at:
  http://perl.apache.org/release/about/link/linktous.html

The logo  banners and the buttons use a different version of the logo
(with _ or without).  I don't care which one we use, but we should be
consistant.  It's branding after all...

The logo at the top of the page also uses a different weighting on the 
font, where the word 'perl' isn't as bold as the others.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Image manipulation recommendation?

2002-06-28 Thread Mark Fowler

On Thu, 27 Jun 2002, Ryan Thompson wrote:

 I'm working on a mod_perl web project in which it would be *really*
 quite handy if I could dynamically rasterize text over existing images.

Apache::ImageMagick ?
http://search.cpan.org/search?dist=Apache-ImageMagick

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: URL

2002-06-14 Thread Mark Fowler

On Thu, 13 Jun 2002, Rasoul Hajikhani wrote:

 Is there a way to read the actual URL typed in the location box of the
 browser?

What's actually typed into the location bar on a browser isn't sent in the 
HTTP headers, and thus mod_perl cannot access it.  For example, you may be 
able to type in your browser cnn but your browser will munge that to be 
a request for http://www.cnn.com/; and that's what it will send in the 
HTTP headers not the orignal cnn

If you're happy getting that level of detail then there are many ways to 
do it which are covered in the guide.

For a certain platform (browser) you *may* be able to access the urlbar 
though a plugin, though javascript or though using a keyword system.  
Methods for doing this however are offtopic for this list and I wish you 
luck in finding solutions.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: separating C from V in MVC

2002-06-14 Thread Mark Fowler

On Fri, 14 Jun 2002, Nigel Hamilton wrote:

   Generally I try to minimise the layers/tiers/abstraction between
 the front-end and the database - for me OO/SQL abstraction is something
 akin to 'GOTO considered harmful'.

I think there's room for middle ground here between mapping OO directly 
to SQL and having SQL in heredocs in your code.  What we tend to use is a 
object that works almost as a SQL factory.  We never have SQL directly in 
our code, but rather all this is placed inside a seperate module.that 
knows a few things about itself - e,g, what database and table we're 
using for this run.  This can be then used to spit out SQL or run the 
query and return the results.

The key aspect is that anytime you feel you need to write some SQL you 
should feel free to add more SQL to this module - not limit yourself to 
waht's already avalible.

The advantage of this is that we get better reuse in out of our SQL when
we need the same function called from many places, and we can reuse the
same SQL on similar tables/databases for different runs.  Another
advantage is that should we ever want to change the database all our SQL
is in a few modules and we can make sure that we change all our SQL.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: OSC early bird and mod_perl T-Shirts

2002-06-10 Thread Mark Fowler

On Mon, 10 Jun 2002, Adam Worrall wrote:

 It might be nice it some T-shirts were available (somehow) to
 non-attendees - after all, every shirt worn is advertising ;)

Yeah, considering that some of us can't afford the flight all the way to 
the states, and even some of us don't want to enter the country for 
political reasons, it might be nice to at least have them at other 
conferences...YAPC::Europe 2002 for example.

Mark

(Who has too many perl tshirts, but wouldn't mind another)

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Memory Leaks

2002-05-20 Thread Mark Fowler

On Mon, 20 May 2002, Matt Sergeant wrote:

 if ($@  $@-isa('Exception::DB')) {
debug Exception: $@;
$um-dbh-rollback;
 }
 
 (note: if you expect all exceptions to be references like this, you had
 better have a $SIG{__DIE__} handler installed to bless non-blessed
 exceptions before re-throwing them

Can't you just use UNIVERSAL's ISA method directly?  

   if (UNIVERSAL::isa($@,'Exception::DB')) {

This of course might fail if you got the string Exception::DB or 
likewise back as an error message.

Alternativly, check if it's blessed

   use Scalar::Util qw(blessed);

   if (blessed($@)  $@-isa('Exception::DB')) {

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Force a 404 error?

2002-05-16 Thread Mark Fowler

On Thu, 16 May 2002, Jonathan M. Hollin wrote:

 Is it possible to force a 404-error from within a mod_perl CGI?

I'm not sure what you mean by a mod_perl CGI.  Anyway, basically you
need to return the 404 error code in the HTTP response and provide some
helpful HTML.

In CGI this can be done like so:

#!/usr/bin/perl -wT

use strict;

use CGI;
my $q = CGI-new();

# okay, send the header so the browser knows it's a 404
print $q-header(-status = 404);

# now print something that looks like a normal 404 page
my $url = $ENV{REQUEST_URI};
$url = $q-escapeHTML($url);  # be paranoid re cross site scipting

print ENDOFHTML;
!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
htmlhead
title404 Not Found/title
/headbody
h1Not Found/h1
The requested URL $url was not found on this server.p
hr
address$ENV{SERVER_SOFTWARE} at $ENV{SERVER_NAME} Port 
$ENV{SERVER_PORT}/address
/body/html
ENDOFHTML

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: we need mod_perl banners

2002-05-14 Thread Mark Fowler

On Tue, 14 May 2002, Stas Bekman wrote:

 [ creating banners, etc ]

Do we have the source for those banners anywhere?  Preferably vector, or 
at least telling us what font the original was in.  I don't think anyone 
wants to work from bitmap.

I seem to remember matts doing something with SVG a while back, but him 
waiting on the correct font (my memory is a bit vague on this)

(Insert joke about needing the src and closed source banners here)

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}





Re: [RFC] Dynamic image generator handler

2002-05-10 Thread Mark Fowler
 to keep a scoreboard of how many images have been 
generated in the last x minutes to stop generating for things like runaway
spiders (though OTOH, this could probably be better handled by another 
module somewhere else in the chain)
 
 My current code uses GD for text writing

As does mine.  TBH, the hardest thing I had was designing the interface 
and doing the maths to work out where everything goes when you've got 
several competing criteria manipulating the image.  The underlying image 
system wasn't that important.

I'd considered renaming GD::TextImage to TextImage::GD should 
TextImage::ImageMagick etc should happen.

 *) File Expiration Headers and Browser Caching

Not even considered.
 
 *) Current and Future Uses

 I have recently released version 1.0 of an all-XML content management
 system (although it is not yet available for public use...sorry), and
 this means people can edit their entire site, not just plain text. They
 can completely change their sitemap structure interactively, and all
 site images relating to the sitemap automagically change.

I was planning to do something similar with Template Toolkit and the 
XML::XPath plugin.

 Looking forward, I would like to be able to use this for more than just
 text. I'd like my customers to be able to select an image, set the
 maximum size, check a few boxes or radio buttons to say what formatting
 options they'd like, and the image is automagically resized without
 wasting disk space or taking a long time to download.

Disk space cheap, CPU cycles expensive.

 I'm sure there are plenty of other uses for this, but I'll leave it at
 this.

I'm warey of creating a all too powerful module.  It's taken me an age to 
come up with an interface that I think (IMHO) that has a sensible user 
interface.  I wouldn't want to create something too powerful.

I've left hooks in my code.  That's all I can do.

 I have to make some subtle feature additions to this code within the
 next few weeks (months?), and instead of just performing a knee-jerk
 reaction and hacking on some cruft to my existing module, I wanted to
 open this up to the mod_perl developer community as a whole, to see if
 this is something others can use.

It sounds good to me.

Later.

Mark. 

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: [ANN] Testing Tool for mod_perl CGI Applications: Puffin

2002-05-05 Thread Mark Fowler

What's a mod_perl CGI Application?

:-)

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Scope of Perl Special Variables

2002-05-05 Thread Mark Fowler

On Sun, 5 May 2002, Jon wrote:

 I thought that using 'local' would successfully scope those globals to
 within a sub, so you could,k for example, slurp an entire file by doing:
 
 local $/ = undef;
 my $file = FH;
 
 Or am I wrong in that?  I use it frequently, and don't seem to have any
 troubles.

Okay, local takes a temporary copy of the variable and then restores the
original value at the end of the block.  It's the same variable though. my
creates a new variable that is only visible from within the block and
can't be seen from other subroutines.  With my there are two variables 
that just happen to be called the same things, and which one you get 
depends if you're in within the enclosing block.

The difference is that when you use local any subroutines that you call
from within that subroutine will *also* see the variable.  With a 
my variable whatever you change can't be seen in other subroutines

The practical difference is if you set $/ and you call any routine from
within that same subroutine (that same block) they will also see the new 
version of $/.  This means that anything that you call from within that 
routine will also slurp in the whole file when it tries to read a line - 
if it was expecting it or not.

In terms of mod_perl this isn't so bad.  The local is fine when used in a 
subroutine like you described, as this subroutine will be exited by the 
time the handler returns, meaning you won't get any interaction between 
calls.

Of course there's still ways for you to screw yourself over with local, 
but used carefully it should be fine...

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Perl Callbacks not working

2002-05-01 Thread Mark Fowler

On Tue, 30 Apr 2002, Vitor wrote:

 use strict;
 use Mail::CClient qw(set_callback);
 set_callback (login= sub { return (login,password); } )

I don't see any reason why this shouldn't work.  Acmemail (which runs fine 
under mod_perl) uses Mail::CClient with callbacks without problem.

 I think this is related with the cacching feature of mod_perl that need to
 be disabled for pages that uses these callbacks.

What are you expecting to happen here?  When Mail::CClient needs a login 
it will call the anonymous subroutine passed on login which will simply 
return the two values login and password.  These need to be set to the 
login and password of your POP/IMAP/Whatever account.

You could be getting things confused with closures here, it's reasonably 
easy to do.

  sub init
  {
 my $login,$password;
 set_callback (login= sub { return ($login,$password); } )
  }

Will not login no matter what you set $login or $password to be later as 
the anonymous subroutine will be bound to the particular $login and 
$password created in init.

Hope this is helpful (and the problem isn't more serious)

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Trapping browser events

2002-04-12 Thread Mark Fowler

On Fri, 12 Apr 2002, Jacob Elder wrote:

   last if $r-connection-aborted;

There's a more full discussion of this in the mod_perl developer's 
cookbook in section 4.8.

They postulate a module for checking a little more carefully, source of 
which is here:

http://www.modperlcookbook.org/code/ch04/Cookbook/CheckConnection.pm

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}







Re: Help Requested: Segfault 11 7 MONTHS after compilation on multipleservers all compiled the same running different code and different RedhatReleased all on the same day [BUG]

2002-04-09 Thread Mark Fowler

On Tue, 9 Apr 2002, Stas Bekman wrote:

 Looks like you cannot run the Inline code under mod_perl. I remember 
 Brian told me the secret code to make it work under mod_perl :)

Ah, this might be it.  The first time the Inline code is run the ILSM
(Inline Support Module) compiles[1] the code.  It then stashes this away
in the .Inline directory, then reads this 'compiled' code back in again
this, and every other time, it's called. If it can't do that then 
this could be a problem.

I'd be tempted to run the code as someone who has rights to write in the
directory for the first time after I'd installed it/made any changes.  
Make sure your webserver has permissions to read these files.  Don't
change the source file (any part of it, even the perl part) without
rerunning the code as that privileged user (to recompile it.)

 [ snip lots of code ]

 make sure that /tmp/Inline is writable by the webserver.
 Hopefully you will figure out how to fix completely Bad::Segv and I'll 
 have more time to do other things :) Thanks.

Um...if you do this arn't you essentially creating a directory where you 
can store executable code that will be read in by your webserver and run 
that can be written to by your webserver?  Isn't this a little insecure?

Later.

Mark.

[1] Compiles in the looses sense of the word.  Very accurate for C, less 
true for other languages.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: tt2 using mason tags

2002-04-08 Thread Mark Fowler

On Mon, 8 Apr 2002, Rafiq Ismail (ADMIN) wrote:

 Converting Mason to TT2 stuff

Hi.

May I suggest you repost this to the template toolkit list?
http://www.template-toolkit.org/mailman/listinfo/templates

Sounds like you're getting confused between [% %] for template code 
and [% PERL %] ... [% END %] for actual real perl code

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Unable to extract tomcat distribution - Please help

2002-03-29 Thread Mark Fowler

On Thu, 28 Mar 2002, Kairam, Raj wrote:

 Any help will be very much appreciated.

Help with tomcat can be found on one of the Jakarta mailing lists.
http://jakarta.apache.org/site/mail.html

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}





Re: [ANNOUNCE] The New mod_perl logo - results now in...

2002-03-15 Thread Mark Fowler

On Fri, 15 Mar 2002, Jonathan M. Hollin wrote:

 However, I request your comments on this idea:  should we have just one
 button (helping to develop a distinct identity for mod_perl) or should
 we have several (for choice)?  It's up to you...

I think that we need one theme of buttons, to ensure consistent
branding.  As per my comments when I voted stated, I'd love to see some
buttons/logos based on the winning logo.  In particular:

 - A square button that's just made up of the square cog logo
 - A square button that's just made up of a grey m and a blue p
 - A small rectangle version of the words modperl without the cog

...you get the idea, variations around a central design

Also, we could do with both a monochrome and a black and white version of 
the logo (for print.)

Is the logo available in a vector file format so that we can easily make 
scaled copies of it?  Or are we restricted to the pixel banners that 
currently exist?

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Hi........

2002-03-09 Thread Mark Fowler

On Sat, 9 Mar 2002, Balaji_Mahalingam wrote:

   I am new to this place.

Greetings.  May I suggest a more informative subject line next time - I 
almost deleted it by mistake because that's how quite a lot of the spam I 
get starts ;-)

 Can any one send me the installing and configuring
 details of mod_perl-1.26

There's installation instructions in the Guide:
   http://perl.apache.org/guide/install.html

There's help in the mod_perl cookbook, chapter 1
   http://www.modperlcookbook.org/chapters.html.
   http://www.modperlcookbook.org/chapters/ch01.pdf
   (and in bookshops)

Feel free to ask for help if you've got any problems, just send details of 
any error messages, the nature of the problem and what systems you're 
trying to install it on (with what technique) and I (or others) will do 
our best to help you.

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: here is a good modperl question on perlmonk

2002-03-06 Thread Mark Fowler

On Tue, 5 Mar 2002, Medi Montaseri wrote:

 Stuart Frew wrote:
 
  Ideally you would have linux( or what ever) on every developers
  machine but sometimes you don't get the choice.
 
 Oh the choice is easyjust come in on a weekend and install
 linux on your box. Don't tell IT. That's all.

I think the don't get a choice is more to do with that you require 
access to some application that requires MS windows to run.  This is 
typically Exchange, Word, and most importantly iexplore for testing 
the website you are developing.  There are solutions to this:

 a) Terminal Server.  Get one Windows box running terminal server (the
server version of w2k ships with it by default iirc) and install 
rdesktop[1] on your desktop Linux machines.  This means you 
can all remotely open up a window to a Windows desktop on your linux
box.

It's reasonably fast but you will be limited to 256 colours and
animations will be slow.

 b) VMWare (and similar) that allows you to run an emulated Windows
computer on your real computer.

I tried the trial version of this but I found it was taking up too
much resources on my desktop.  OTOH, I never had any problem with it
and it worked flawlessly, and my desktop machine is quite slow by
modern standards.

 c) VMWare the other way round - run it on Windows and have emulated
linux boxen.  The advantage of this is that you'll be able to quickly
switch between a range of development environments, roll back changes
etc. etc.  I've never personally tried this solution...
 
 d) WINE on Linux.  I've not had much success with this, but if it's a 
particular application you might have success.

[a] requires purchase of one w2k server licence and one computer 
(though you might have one that has some spare processing time) and will 
free up the Windows licences for the desktop machine. [b] and [c] require 
one VMWare per machine.  IIRC that's quite expensive.  [d] is the cheapest
option, and you might even be able to dump your existing windows licence.

Regards.

Mark.

[1] http://www.rdesktop.org/

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}





Re: Breaks in mod_perl, works in Perl

2002-03-06 Thread Mark Fowler

On Thu, 7 Mar 2002, Stas Bekman wrote:

 Mark Hazen wrote:
  That's your opinion.  In my opinion, a bunch of disk IO and file seeks are a
  waste of resources.  The bigger issue here is that it is better to store in
  memory, and it saddens me that it doesn't seem possible.
 
 Hmm, then create a ramdisk and read from the file virtually stored in 
 the RAM.

Why should this be necessary?  Since writes to disk don't happen 
immediatly writing to 'disk' and reading it back in again and then 
deleting the file should all happen in cache and not actually hit the hdd 
at all (unless of course you run out of memory in which case slamming it 
to disk would be no worse than a page hit) correct?

Or am I missing something?

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}





Re: trouble with mod-perl soap handler

2002-02-27 Thread Mark Fowler

On Wed, 27 Feb 2002, Rizwan Majeed wrote:

 I am using the mod-perl handler for soap.  I wasnt sure how to test it.
 Can any body tell me how to test the service I make.

Hi.

I was playing with this stuff yesterday, so here are some points from 
someone who's new to this stuff

First off, there's an example in the mod_perl cookbook.  See chapter 15,
secion 15.16 Creating a SOAP server.  In particular, the listing you
might want to take a look at is the example of a script that calls thier
soap server server.

http://www.modperlcookbook.org/code/ch15/HalfLife-QueryServer-0.10/eg/querysoap.pl

Secondly, have a look at Leon Brocard's stuff at  
http://www.astray.com/services/  This is a further example of using SOAP - 
this time to call a infobot.

Basically what you want to do from your client is

#!/usr/bin/perl

use SOAP::Lite +autodispatch =
  uri   = 'Some unique uri to identify your request',
  proxy = 'The url that is in your Location in httpd.conf';

my $object = NameOfMySOAPedModule-new();
$object-a_method();
$object-an_other_method();

 MORE Importantly. how should I make sure the handler is invoked. I think
 it is not being invoked. I have also copied the package in the perls
 @INC path //site_perl. The package has a handler function that
 should be invoked.

Try GETing the url.  Assuming you have LWP installed:

[mark@pate mark]$ GET http://2shortplanks.com/mod_soap
HTML
HEADTITLEAn Error Occurred/TITLE/HEAD
BODY
H1An Error Occurred/h1
405 Method Not Allowed
/BODY
/HTML

For a simple GET if the handler is being called you should get the 405 
(as you didn't issue a proper soap request.)

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Net::LDAP::Extension

2002-02-27 Thread Mark Fowler

On Wed, 27 Feb 2002, [EMAIL PROTECTED] wrote:

 hi,
   Have you looked at CPAN 

In particular you might want to have a look at search.cpan.org which will 
allow you to search for modules and read the built in documentation 
(called pod - ships with every module on CPAN) on the web before you 
install it.

http://search.cpan.org
http://search.cpan.org/search?mode=modulequery=Net::LDAP::Extension

Are you enquiring which pod in particular links to the documentation for 
Net::LDAP::Extension within the perl-ldap distribution?  Normally each 
module has it's own pod, but sometimes - when it's clearer - a collection 
of modules are described at once in other module's pod.  

Net::LDAP::Extension doesn't seem to have any pod itself, so maybe 
someone else who's used the package could point out which bit of the 
perl-ldap documentation describes it.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}






Re: Image Magick Alternatives?

2002-02-18 Thread Mark Fowler

On Thu, 21 Feb 2002, Issac Goldstand wrote:

 Apache::GD::Thumbnail - CPAN friendly.  It needs, however, GD, which 
 means that instead of using Perl Magick for the sole use of generating 
 thumbnails, you'll be using GD for the sole purpose of generating 
 thumbnails...  Also, it only has jpeg support currently...
 
 But it _is_ easy :-)

GD isn't actually that easy to install.  Trust me, I've been hacking at it 
all afternoon.  You'll need to download the C code and install if first 
(along with any other supporting software that requires,) then install 
GD.pm from CPAN. 

The install's not *so* bad if you

 a) don't require freetype support (for producing truetype font support 
which you won't for thumbnails) or XPM support (which you also won't
need for producing thumbnails)

 b) have things like libpng and libjpeg already installed with the header 
files (a nice Linux distribution might do this)

 b) patch gd with the patch that ships with GD.pm to use gnu configure

and then use the ./configure script remembering to help it out with 
--libdir and --includedir to point to the lib and include dirs with the 
right headers in if it can't automatically find them

Said simply, it's not a simple CPAN install.

If you have any problems, give me a shout and I'll see if I can help, 
since it's all fresh in my mind atm.

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: [OT] Moving WYPUG

2002-02-15 Thread Mark Fowler

On Fri, 15 Feb 2002, Jonathan M. Hollin wrote:

 I now need to install some Perl modules (DBD-MySql, Image-Magick, etc).
 Under ActivePerl on WYPUG's current Win2K box, I would simply use the
 Perl Package Manager (PPM) to download and install these modules.  Is
 there an equivalent under Unix?

You can get ppm for Linux.  I don't think many people use it.

 If not, what's the best way to install modules?  In short, what do I
 need to know?

(as root)

$ perl -MCPAN -e shell; [1]

(answer loads of really simple config questions the first time you 
install - just accept the defaults)

cpan install Acme::Buffy;

installs Acme::Buffy from source, hopefully asking you about 
installing prerequisites first if it needs them (or just installs them 
automatically if you selected follow during the config)

Later.

Mark.

[1] The command 'cpan' is often set up as an alias for this on many 
systems

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: New mod_perl Logo

2002-01-29 Thread Mark Fowler

On Tue, 29 Jan 2002, Michael A Nachbaur wrote:

 Well, seeing as this would be the new version of mod_perl, I could see it
 being worth ORA's while to forgo their little copyright nonsense.  I'm sure,
 if a really nice design comes up with the mod_perl eagle, that ORA wouldn't
 mind bending their copyright for us.  After all, its extra publicity for
 them, right?

That's not how trademarks work.  ORA have to complain about every use of 
a trademarked form that comes to their attention, otherwise the trademark 
lapses.

If their trademark lapses, then someone else can produce Eagle books.

To borrow the really horrible slashdot phrase though, I am not a lawyer

Later.

Mark

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}





Re: Single login/sign-on for different web apps?

2002-01-17 Thread Mark Fowler

On Wed, 16 Jan 2002, Mark Maunder wrote:

 The only way I could come up with, was to have the browser redirected
 to every domain name with an encrypted uri variable to prove it is
 signed on which causes each host included in the single sign on to
 assign an auth cookie to the browser.

Instead of redirecting the entire page you could just include images
(the typical 1x1 pixel) from each server on the You've been logged on 
page and have each of them set a cookie for that domain name.

For this to work with modern browsers (i.e. IE6 and properly configured
mozillas) you'll need to include a compact policy in your P3P header[1],
otherwise the browser will consider this an unauthorised attempt to serve
a third party image and block the cookie.

Later.

Mark.

[1] See http://www.w3c.org/p3p/, 
http://2shortplanks.com/temp/P3P-ToCP-0.02.tar.gz for more information

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Fast template system

2001-12-30 Thread Mark Fowler

On Sun, 30 Dec 2001, Kenny Gatdula wrote:

 I think you'll have an easy time converting your homegrown templates over 
 to Template Toolkit, and, since it's fast, it should meet your needs.
 
 here's your example using tt's syntax.

Using Apache::Template (the Apache/mod_perl interface to the Template 
Toolkit) you can just set the tag delimiters to use html comments by doing

 TT2Tagshtml

In your httpd.conf.  Of course, TMTOWTDI, and you can also switch the 
comments in the template itself with a [% %] directive at the start, pass 
different arguments to Template.pm or it's submodules in your own custom 
handlers etc.

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}





Re: Tips tricks needed :)

2001-12-20 Thread Mark Fowler

(sorry to break threading but I'm getting this from multiple lists)

 that IE 6 (beta at the time) considered my cookies to be third party
 because I used frame-based domain redirection and by default would not
 accept them.

You need to include a P3P header in your HTTP header that contains a
Compact Policy (CP) - a geek code of what your P3P xml privacy document
contains.  See http://www.w3c.org/P3P/.

Some research I did seems to indicate that current implementations of IE6
 will accept cookies no matter what CP you use (rather than checking it
against your security settings and deciding if the CP represents a
privacy policy that violates your chosen level of disclosure.)  I'd really
appreciate it other people could check this and confirm that IE6 is not
offering any actual privacy level protection and is just discriminated
against people that don't have P3P headers.

My (Profero's) module for automagically converting a P3P document (the 
xml) into a CP (the geek-code version of that xml document) is in beta
here:

http://twoshortplanks.com/temp/P3P-ToCP-0.02.tar.gz

Please test, break and get back to me when it doesn't work.  It just 
follows the spec and uses XML::XPath to pull the stuff out.

Later

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: load balancing on apache

2001-12-14 Thread Mark Fowler

On Fri, 14 Dec 2001, Hemant Singh wrote:

 Pls suggest how can i achieve this on apache.

mod_backhand may be able to help you out here with proper pass it on  
type load balancing.  If you use it with wackamole you might not even need
the front machine.

http://www.backhand.org/

Haven't used it myself, but people I know say good things about their 
experiences with it.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: Perl and Microsoft Excel?

2001-11-29 Thread Mark Fowler

On Thu, 29 Nov 2001, Tom Servo wrote:

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

Spreadsheet::ParseExcel and Spreadsheet::WriteExcel?  Both have ::Simple 
versions too.

I've used them in the past and it's Worked For Me (tm)

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}




Re: [OT] P3P policies and IE 6 (something to be aware of)

2001-10-31 Thread Mark Fowler

On Tue, 30 Oct 2001, Robin Berjon wrote:

 If anyone feels like undertaking this task, imho the best
 first step would be to produce XML::P3P (it's not Apache dependent)
 and add Apache::P3P as a wrapper around that that would take care of a
 few simple things such as setting the headers properly and so forth.

Hi.  Don't normally post or read this list but Leon Brocard pointed this
out to me.

I've been doing a lot of work for my company on what you talking about.
Code is available at: http://2shortplanks.com/temp/P3P-ToCP-0.02.tar.gz.
Documentation (html of the pod) is also at
http://2shortplanks.com/temp/P3P_ToCP.html This is a beta version of a
module that will take a P3P document and create a CP version of it that is
suitable for inserting in the HTTP P3P header.

This will go up on CPAN very soon, as soon as we've worked out what to
call it.  I've been in discussion with the modules list about what it
should be named (as there are thoughts that it shouldn't go in the XML
name space.)  Any ideas on this would be appreciated.

Apart from that it's pretty much complete (but I really could do with some
feedback on the code too.)  Some additional documentation regarding P3P
and p3p2cp (a command line script to trigger the module) probably could
do with being written.

As goes for integrating it with apache, I guess the most sensible thing
to do would be to parse the P3P policies at start up and cache the headers
that should be delivered each request.

Hope this is of some help.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}