Re: Mason

2012-03-02 Thread Kevin Falcone
On Thu, Mar 01, 2012 at 12:45:24AM +0100, Paul Johnson wrote:
 Disadvantages are that it's tied to mod_perl.  I believe that means that
 you can't bring plack into the equation which, in turn, means that you
 can't take advantage of the plack middleware.  I'd be pleased to be
 shown that I'm mistaken here.

We ran mason under fastcgi for years before Plack came along, and
these days we use HTML::Mason::PSGIHandler.

I'm not a fan of the dispatcher in mason, but I don't object to the
templating system (provided you avoid the pitfalls you mentioned of
defining an actual subroutine rather than a subref, and avoid some of
the more interesting features such as METHOD blocks).

-kevin


Re: Mason

2012-02-29 Thread Dave Cross

Quoting Christopher Jones c.jo...@ucl.ac.uk:

I'm looking for a decent book to help get me up to speed with Mason  
but could only find Embedding Perl in HTML with Mason on Amazon -  
a paper edition from 2002 and a more recent 2010 edition on Kindle  
only.


I'm a bit old fashioned and prefer to have a paper copy that I can  
scrawl all over - so does anyone know if/when the new edition is  
expected in paperback and is it worth buying?


The book web site (http://www.masonbook.com/) has no mention of an  
updated revision, so I'm betting that the later date on the kindle  
edition is just the date that the kindle version of the original  
edition was published. For example, the kindle edition of the TT book  
is dated 7 Jun 2011, but I know that's the same as the 2003 edition).


(BTW I'm just assuming the 2002 edition is *way* out of date - but  
correct me if I'm wrong!)


No idea. 2002 was about the last time I looked at Mason :)

Dave...



Re: Mason

2012-02-29 Thread Leo Lapworth
On 29 February 2012 16:10, Dave Cross d...@dave.org.uk wrote:
 Quoting Christopher Jones c.jo...@ucl.ac.uk:

 I'm looking for a decent book to help get me up to speed with Mason but
 could only find Embedding Perl in HTML with Mason on Amazon - a paper
 edition from 2002 and a more recent 2010 edition on Kindle only.

Mason 2 was released:  Feb 16, 2011 - I'm guessing (but don't know)
that it changed quite a bit.

Personally I use Plack + Template toolkit + Catalyst mostly.

But not sure _why_ you want to learn Mason, if it's for an existing site then
the book may be of use.

Leo


Re: Mason

2012-02-29 Thread Jones, Christopher
On 29 Feb 2012, at 16:10, Dave Cross wrote:

 I'm betting that the later date on the kindle edition is just the date that 
 the kindle version of the original edition was published. For example, the 
 kindle edition of the TT book is dated 7 Jun 2011, but I know that's the same 
 as the 2003 edition).

That makes sense - thanks for pointing that out!


Chris







Re: Mason

2012-02-29 Thread Jones, Christopher
On 29 Feb 2012, at 17:11, Leo Lapworth wrote:

 Quoting Christopher Jones c.jo...@ucl.ac.uk:
 
 I'm looking for a decent book to help get me up to speed with Mason but
 could only find Embedding Perl in HTML with Mason on Amazon - a paper
 edition from 2002 and a more recent 2010 edition on Kindle only.
 
 Mason 2 was released:  Feb 16, 2011 - I'm guessing (but don't know)
 that it changed quite a bit.
 
 Personally I use Plack + Template toolkit + Catalyst mostly.
 
 But not sure _why_ you want to learn Mason, if it's for an existing site then
 the book may be of use.

New job, old tricks new to old dog

Have to confess, I didn't realise Mason (1) was quite *that* old



Chris







Re: Mason

2012-02-29 Thread Dave Hodgkinson

On 29 Feb 2012, at 17:11, Leo Lapworth wrote:

 On 29 February 2012 16:10, Dave Cross d...@dave.org.uk wrote:
 Quoting Christopher Jones c.jo...@ucl.ac.uk:
 
 I'm looking for a decent book to help get me up to speed with Mason but
 could only find Embedding Perl in HTML with Mason on Amazon - a paper
 edition from 2002 and a more recent 2010 edition on Kindle only.
 
 Mason 2 was released:  Feb 16, 2011 - I'm guessing (but don't know)
 that it changed quite a bit.
 
 Personally I use Plack + Template toolkit + Catalyst mostly.
 
 But not sure _why_ you want to learn Mason, if it's for an existing site then
 the book may be of use.
 

Indeed. Replace it with a less powerful home-brew templating system.


Re: Mason

2012-02-29 Thread Jérôme Étévé
On 29 February 2012 17:11, Leo Lapworth l...@cuckoo.org wrote:
 On 29 February 2012 16:10, Dave Cross d...@dave.org.uk wrote:
 Quoting Christopher Jones c.jo...@ucl.ac.uk:

 I'm looking for a decent book to help get me up to speed with Mason but
 could only find Embedding Perl in HTML with Mason on Amazon - a paper
 edition from 2002 and a more recent 2010 edition on Kindle only.

 Mason 2 was released:  Feb 16, 2011 - I'm guessing (but don't know)
 that it changed quite a bit.

 Personally I use Plack + Template toolkit + Catalyst mostly.

 But not sure _why_ you want to learn Mason, if it's for an existing site then
 the book may be of use.


There's plenty of good reasons to use Mason (and it's latest Moosified
incarnation), but here's a few:

- Pages inherit from each other, and now it's got all the Moose power.

- It helps you to catch errors early and easily.

- You're not restricted to a mini-language that only (almost) make
sense if you're not a programmer. Unless you use Perl blocks.

- Because the code is Perl, you've got all the Perl goodness right
there for you, should you need to do some complex things (I'm talking
rendering only here, don't get me wrong :) ).

- It plays very well as a templating system only, which is probably
the way you want to use it those days. I'd agree the dispatcher part
of it would probably be better as a plugin for those who are really
allergic to other MVC's

Anyone advocating TT for the protection it provides against bad
practices should have a look at that:
http://search.cpan.org/dist/Template-DBI/

J.

-- 
Jerome Eteve.

http://sigstp.blogspot.com/
http://twitter.com/jeteve



Re: Mason

2012-02-29 Thread Leo Lapworth
On 29 February 2012 18:41, Jérôme Étévé jerome.et...@gmail.com wrote:
 On 29 February 2012 17:11, Leo Lapworth l...@cuckoo.org wrote:
 But not sure _why_ you want to learn Mason, if it's for an existing site then
 the book may be of use.

 There's plenty of good reasons to use Mason (and it's latest Moosified
 incarnation), but here's a few:

Just for clarity, the _why_ was asking if it was for an existing Mason 1
site, or if he was starting a new project. Not saying that Mason shouldn't
be used (each to their own and all that).

Mind you at the same time, I wouldn't promote it...

I think it' is possible to create good Mason sites, I've just not
seen or heard of any that didn't end up being a twisty maze with
logic in too many places and little/no MVC separation. This was
all pre Mason2 which I've not looked at either so things may
have changed and as I say, I'm sure it is possible.

Leo

ps. https://metacpan.org/module/Task::Kensho always useful if your looking for
what some people think is currently being used in production by a lot
of clueful people.



Re: Mason

2012-02-29 Thread Paul Johnson
On Wed, Feb 29, 2012 at 06:21:04PM +, Jones, Christopher wrote:
 On 29 Feb 2012, at 17:11, Leo Lapworth wrote:
 
  Quoting Christopher Jones c.jo...@ucl.ac.uk:
  
  I'm looking for a decent book to help get me up to speed with Mason but
  could only find Embedding Perl in HTML with Mason on Amazon - a paper
  edition from 2002 and a more recent 2010 edition on Kindle only.
  
  Mason 2 was released:  Feb 16, 2011 - I'm guessing (but don't know)
  that it changed quite a bit.
  
  Personally I use Plack + Template toolkit + Catalyst mostly.
  
  But not sure _why_ you want to learn Mason, if it's for an existing site 
  then
  the book may be of use.
 
 New job, old tricks new to old dog
 
 Have to confess, I didn't realise Mason (1) was quite *that* old

I've learnt enough Mason in the last year to keep an old site up and
running and extend it as required before it gets replaced by a .net
system.  (Yeah, yeah.)  From my point of view, there's little to
recommend using Mason nowadays.  Mason 1 that is, I have no knowledge of
Mason 2.

The only advantage I can think of is that you might like its templating
system.  Personally, I don't really, but I can believe that others
might.

Disadvantages are that it's tied to mod_perl.  I believe that means that
you can't bring plack into the equation which, in turn, means that you
can't take advantage of the plack middleware.  I'd be pleased to be
shown that I'm mistaken here.

Additionally, each template is in the same namespace, and is basically
the body of a subroutine.  This essentially means that you can't use
named subroutines in templates.  You can look on this as encouragement
to move your logic into modules but, as Leo notes, the other side is
that the components can get very messy if you don't heed this
encouragement.

And then I had to hack Mason itself in order to get code coverage
information from the components.

I managed alright with the online book that Dave mentioned, but I wasn't
trying to learn it thoroughly - just well enough.

My best tip, if you need to work with Mason, is to look at the compiled
code in the mason_cache directory to see what's really happening.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net


Mason

2012-02-27 Thread Christopher Jones
I'm looking for a decent book to help get me up to speed with Mason  
but could only find Embedding Perl in HTML with Mason on Amazon - a  
paper edition from 2002 and a more recent 2010 edition on Kindle only.


I'm a bit old fashioned and prefer to have a paper copy that I can  
scrawl all over - so does anyone know if/when the new edition is  
expected in paperback and is it worth buying?


(BTW I'm just assuming the 2002 edition is *way* out of date - but  
correct me if I'm wrong!)




Chris





Mason Vs Template Toolkit

2002-04-18 Thread Rafiq Ismail (ADMIN)

Hi,

I need some quick references and points, if anyone is free.

We've got this Mason only, bosses pet, who is trying to challange our
decision to rebuild a site in Template, as opposed to Mason.  My initial
reasons were that template allows us to build a more generic system which
is not just web-centred.  Also that it's more usable for designers.  We've
got to defend this soon.  I'd appreciate some pointers about session
management approaches vs Mason custom.  Also about companies using
Template and other good reasons to go with template.

Anyone up at this time?


Cheers,

Fiq


__  __   _ __  __
|  \/  | ___   __| | ___ _ __ _ __ |  \/  | __ _ _ __
| |\/| |/ _ \ / _` |/ _ \ '__| '_ \| |\/| |/ _` | '_ \
| |  | | (_) | (_| |  __/ |  | | | | |  | | (_| | | | |
|_|  |_|\___/ \__,_|\___|_|  |_| |_|_|  |_|\__,_|_| |_|
a pathetic example of his organic heritage
- Bad Religion






Re: Mason Vs Template Toolkit

2002-04-18 Thread Rafiq Ismail (ADMIN)

Come, come.  I need some of these pretty fast.
Big companies using tt2?



__  __   _ __  __
|  \/  | ___   __| | ___ _ __ _ __ |  \/  | __ _ _ __
| |\/| |/ _ \ / _` |/ _ \ '__| '_ \| |\/| |/ _` | '_ \
| |  | | (_) | (_| |  __/ |  | | | | |  | | (_| | | | |
|_|  |_|\___/ \__,_|\___|_|  |_| |_|_|  |_|\__,_|_| |_|
a pathetic example of his organic heritage
- Bad Religion

On Thu, 18 Apr 2002, Rafiq Ismail (ADMIN) wrote:

 Hi,

 I need some quick references and points, if anyone is free.

 We've got this Mason only, bosses pet, who is trying to challange our
 decision to rebuild a site in Template, as opposed to Mason.  My initial
 reasons were that template allows us to build a more generic system which
 is not just web-centred.  Also that it's more usable for designers.  We've
 got to defend this soon.  I'd appreciate some pointers about session
 management approaches vs Mason custom.  Also about companies using
 Template and other good reasons to go with template.

 Anyone up at this time?


 Cheers,

 Fiq


 __  __   _ __  __
 |  \/  | ___   __| | ___ _ __ _ __ |  \/  | __ _ _ __
 | |\/| |/ _ \ / _` |/ _ \ '__| '_ \| |\/| |/ _` | '_ \
 | |  | | (_) | (_| |  __/ |  | | | | |  | | (_| | | | |
 |_|  |_|\___/ \__,_|\___|_|  |_| |_|_|  |_|\__,_|_| |_|
   a pathetic example of his organic heritage
   - Bad Religion









Re: Mason Vs Template Toolkit

2002-04-18 Thread Simon Wilcox

On Thu, 18 Apr 2002, Rafiq Ismail (ADMIN) wrote:

 We've got this Mason only, bosses pet, who is trying to challange our
 decision to rebuild a site in Template, as opposed to Mason.

Well, I've built a CMS in TT and very easy it was too but not what you'd
call a major site.

The largest site I can think of if, of course, slashdot, and there are
lots of slash derived sites.

Your decision comes down to (a) what are your costs for training people in
TT or Mason; (b) How much you want to disengage the logic processing from
the presentation.

TT is very good at keeping logic (i.e. perl code) away from the
presentation. This can be a good thing or a bad thing depending on the
resources you have available and your personal preference.

I am more familar with TT and would use that in almost all situations.
YMMV.

 __  __   _ __  __
 |  \/  | ___   __| | ___ _ __ _ __ |  \/  | __ _ _ __
 | |\/| |/ _ \ / _` |/ _ \ '__| '_ \| |\/| |/ _` | '_ \
 | |  | | (_) | (_| |  __/ |  | | | | |  | | (_| | | | |
 |_|  |_|\___/ \__,_|\___|_|  |_| |_|_|  |_|\__,_|_| |_|
   a pathetic example of his organic heritage
   - Bad Religion

ETOOBIGSIG !

Simon.

-- 
Zaphod old mate, I trust you as far as I could comfortably spit out a
 rat






Re: Mason Vs Template Toolkit

2002-04-18 Thread Leon Brocard

Rafiq Ismail (ADMIN) sent the following bits through the ether:

 I need some quick references and points, if anyone is free.

http://www.perl.com/pub/a/2001/08/21/templating.html may be useful.

I tend to use TT as I like to completely seperate business from
presentation. This way making a SOAP interface / a WAP site / a
digital tv interactive site / a web site in another language / a
postscript document / POD from the same data is really easy.

tt2.org probably needs a TT powered sites list.

Leon
-- 
Leon Brocard.http://www.astray.com/
Nanoware...http://www.nanoware.org/

... But I don't like Spam!




Re: Mason Vs Template Toolkit

2002-04-18 Thread Paul Sharpe



Rafiq Ismail (ADMIN) wrote:
 
 Come, come.  I need some of these pretty fast.
 Big companies using tt2?
 

This

  http://www.perl.com/pub/a/2001/08/21/templating.html

might help.

Cheers,

paul

 __  __   _ __  __
 |  \/  | ___   __| | ___ _ __ _ __ |  \/  | __ _ _ __
 | |\/| |/ _ \ / _` |/ _ \ '__| '_ \| |\/| |/ _` | '_ \
 | |  | | (_) | (_| |  __/ |  | | | | |  | | (_| | | | |
 |_|  |_|\___/ \__,_|\___|_|  |_| |_|_|  |_|\__,_|_| |_|
 a pathetic example of his organic heritage
 - Bad Religion
 
 On Thu, 18 Apr 2002, Rafiq Ismail (ADMIN) wrote:
 
  Hi,
 
  I need some quick references and points, if anyone is free.
 
  We've got this Mason only, bosses pet, who is trying to challange our
  decision to rebuild a site in Template, as opposed to Mason.  My initial
  reasons were that template allows us to build a more generic system which
  is not just web-centred.  Also that it's more usable for designers.  We've
  got to defend this soon.  I'd appreciate some pointers about session
  management approaches vs Mason custom.  Also about companies using
  Template and other good reasons to go with template.
 
  Anyone up at this time?
 
 
  Cheers,
 
  Fiq
 
 
  __  __   _ __  __
  |  \/  | ___   __| | ___ _ __ _ __ |  \/  | __ _ _ __
  | |\/| |/ _ \ / _` |/ _ \ '__| '_ \| |\/| |/ _` | '_ \
  | |  | | (_) | (_| |  __/ |  | | | | |  | | (_| | | | |
  |_|  |_|\___/ \__,_|\___|_|  |_| |_|_|  |_|\__,_|_| |_|
a pathetic example of his organic heritage
- Bad Religion
 
 
 
 

-- 
Paul Sharpe - Technical Director  Tel: +44 (0)1483 894158
Russell Sharpe Ltd.   Fax: +44 (0)1483 898932
The Tannery, Tannery Lane mailto:[EMAIL PROTECTED]
Bramley, Surrey GU5 0AJ, UK




Re: Mason Vs Template Toolkit

2002-04-18 Thread Paul Makepeace

On Thu, Apr 18, 2002 at 10:34:18AM +0100, Leon Brocard wrote:
 Rafiq Ismail (ADMIN) sent the following bits through the ether:
 
  I need some quick references and points, if anyone is free.
 
 http://www.perl.com/pub/a/2001/08/21/templating.html may be useful.
 
 I tend to use TT as I like to completely seperate business from
 presentation.

I'm not all that familiar with Mason although have hacked a little but I
certainly got the impression you could hide away business logic in
modules and use its embedded perl for the presentation only.

There are Mason-to-TT converts on the templates(at)template-toolkit dot
org list you could ask. It'd be biased but it sounds like that's what
you want :-)

Paul

-- 
Paul Makepeace ... http://paulm.com/

If drawing is like riding a bike, then what can you do.
   -- http://paulm.com/toys/surrealism/




Re: Mason Vs Template Toolkit

2002-04-18 Thread Randal L. Schwartz

 Rafiq == Rafiq Ismail (ADMIN) [EMAIL PROTECTED] writes:

Rafiq Hi,
Rafiq I need some quick references and points, if anyone is free.

Rafiq We've got this Mason only, bosses pet, who is trying to challange our
Rafiq decision to rebuild a site in Template, as opposed to Mason.  My initial
Rafiq reasons were that template allows us to build a more generic system which
Rafiq is not just web-centred.  Also that it's more usable for designers.  We've
Rafiq got to defend this soon.  I'd appreciate some pointers about session
Rafiq management approaches vs Mason custom.  Also about companies using
Rafiq Template and other good reasons to go with template.

Rafiq Anyone up at this time?

I just cut over www.stonehenge.com from Mason to Template, after a
long hard look at both.

Big plusses for Template:

+ same technology can be used for the HTML delivery as for all
  the meta work... my config files are now all CVSed and Template'd,
  so I can extract and run a development version of the website easily
  by changing one parameter in a Makefile (all paths change, etc)

+ Template provides a meta-language, much easier grokked by web designers.
  (Ever try teaching a web designer Perl's arcane syntax for hashes
   of hashes?)

+ Template's embedded Perl can be either enabled or disabled, providing
  either flexibility or security

+ Template is in heavy geek use, now that it's been adopted by slashcode.

+ Nearly every step is pluggable and hookable and subclassable (slashcode
  pushed the templates into a database, for example, by simply subclassing
  the provider).

+ Andy Wardley is flexible and a pretty good hacker.

Minuses for Template:

- Caching is not as good as Mason - you have to roll your own solution.
  The Template boys (particularly Perrin, who had lots of experience
  with Template at etoys.com et seq) counter by saying the caching at
  the HTML level is wrong... you should cache the input data and the
  full page views.  I'm beginning to see their point.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL: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!




tt2 using mason tags

2002-04-08 Thread Rafiq Ismail (ADMIN)

Hi,

I'm experimenting with conversion of a mason template based system to tt2.
I tried to set TT2Tags to mason and then to %  however this, even with
the evaluate option to on, doesn't seem to work. (Apache::Template)

I then wrote a custom handler which uses a custom parser, which I've
constructed with the tag style set to mason.  No go there either. I've got
inline perl turned on, however I seem to alternate between a random
permissions error (probably a silly oversight) and an unevaluated
tempalate.

Does this sound familiar?

Has anyone had any success with porting straight from Mason?

Part two would be to replace the inline code with tt2 directives- thought
it was worth mentioning this before getting flamed.  :)

I'm just after evaluation with mason tags.  Anyone?

TIA,
fiq




__
__  __   _ __  __
|  \/  | ___   __| | ___ _ __ _ __ |  \/  | __ _ _ __
| |\/| |/ _ \ / _` |/ _ \ '__| '_ \| |\/| |/ _` | '_ \
| |  | | (_) | (_| |  __/ |  | | | | |  | | (_| | | | |
|_|  |_|\___/ \__,_|\___|_|  |_| |_|_|  |_|\__,_|_| |_|
a pathetic example of his organic heritage
- Bad Religion






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: tt2 using mason tags

2002-04-08 Thread Perrin Harkins

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

Agreed.  Also, any significant Mason component is likely to use Mason's 
built-in object model, which is not part of TT.  You will probably have 
to port some code before it will run.

- Perrin





Re: tt2 using mason tags

2002-04-08 Thread Rafiq Ismail (ADMIN)

 Mark Fowler wrote:
 Agreed.  Also, any significant Mason component is likely to use Mason's
 built-in object model, which is not part of TT.  You will probably have
 to port some code before it will run.

Understood, but it's a small application which is more custom o.o. perl
and inline perl based than it is custom mason.  Other than the fact that
it gets rendered by mason, it is pretty independent.

It's just the fact that in spite of my specifying that it should use
inline_perl, it didn't interpolate the inline code which uses custom
modules in mason tags.  I've got it to try and interpolate now, however it
seems to warn that $VARNAME's are odd symbols.  I'll look at that later.
Going to redo the whole thing in tt2 directives anyway.

Cheers to all.

fiq

__
__  __   _ __  __
|  \/  | ___   __| | ___ _ __ _ __ |  \/  | __ _ _ __
| |\/| |/ _ \ / _` |/ _ \ '__| '_ \| |\/| |/ _` | '_ \
| |  | | (_) | (_| |  __/ |  | | | | |  | | (_| | | | |
|_|  |_|\___/ \__,_|\___|_|  |_| |_|_|  |_|\__,_|_| |_|
a pathetic example of his organic heritage
- Bad Religion





Re: tt2 using mason tags

2002-04-08 Thread Perrin Harkins

Rafiq Ismail (ADMIN) wrote:
 It's just the fact that in spite of my specifying that it should use
 inline_perl, it didn't interpolate the inline code which uses custom
 modules in mason tags.  I've got it to try and interpolate now, however it
 seems to warn that $VARNAME's are odd symbols.

If you post an example of the troublesome templates on the TT list, 
someone will probably be able to help you.

- Perrin