Re: [Catalyst] Re: template comparison (was: why not mason

2006-10-27 Thread Perrin Harkins

A. Pagaltzis wrote:

TT2 provides a single minilanguage for both, which is
unnecessarily powerful and verbose for the 18% and way
underpowered for the 2%.


You're only supposed to use the TT language for simple things.  Hairy 
things are supposed to be encapsulated in plugins, written in Perl.


- Perrin

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst::Engine needs a stop method

2006-10-27 Thread hkclark

On 10/27/06, Jon <[EMAIL PROTECTED]> wrote:

I need to launch a long-running (minutes up to hours) background program
from Catalyst.  I have it working almost well enough - I do the usual
double-fork, closing standard file descriptors, and had to take some
particular care to use POSIX::_exit and put an eval{} around the daemon
code so that if it dies it doesn't return to the Catalyst main loop -
and it runs, exits cleanly and doesn't interfere with other Catalyst
operations.



Hi Jon,

I know this probably isn't the answer you are looking for, but when I
discussed a similar requirement on IRC, they convinced me to write a
POE job server.   I was surprised how easy it was and how well it
works.  I'm using POE::Component::Server::XMLRPC.

Regards,
Kennedy

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Catalyst::Engine needs a stop method

2006-10-27 Thread Jon
I need to launch a long-running (minutes up to hours) background program
from Catalyst.  I have it working almost well enough - I do the usual
double-fork, closing standard file descriptors, and had to take some
particular care to use POSIX::_exit and put an eval{} around the daemon
code so that if it dies it doesn't return to the Catalyst main loop -
and it runs, exits cleanly and doesn't interfere with other Catalyst
operations.

The problem I'm having is when I stop and try to restart the main
Catalyst server before the background process completes (and I do want
it to continue).  In the standalone server configuration, the main
socket (port 3000) gets inherited and left open, so is held by the
background process and prevents the server restarting.

What I need to be able to do is ask the HTTP engine to stop, close all
its file descriptors and clean up.  There doesn't currently appear to be
any elegant way to do this without knowing which engine you're running
and what port it's using, and even then it is problematic to locate the
file descriptor and close it.

It would be nice if there was a Catalyst::Engine::stop method or similar
to complement Catalyst::Engine::run.  mod_perl provides such a thing 
Apache::SubProcess::cleanup_for_exec (see
http://modperlbook.org/html/ch10_02.html).

Has anyone had similar issues and perhaps found other workarounds?

Thanks.


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: template comparison

2006-10-27 Thread Adam Sjøgren
On Fri, 27 Oct 2006 13:02:47 -0500, Jonathan wrote:

> Mason:

> <% my $sth = $dbh->prepare('SELECT columns FROM table WHERE
> something=1'); for($row = $sth->fetchrow_arrayref){ %>

[...]

> TT (in Cat with DBIC):

> 
> [% WHILE (row = rows.next) %]
> 
>   [% row.name | html %][% row.whatever | html %]
> 
> [% END %]
> 

I think a fair comparison would be:

 Mason (in Catalyst using DBIx::Class):

 
 % while (my $row=$rows->next) {
 
   <% $row->name |h %><% $row->whatever |h %>
 
 % }
 

For me there is not much gained by learning yet another syntax for
looping, branching, outputting stuff (Template::Toolkit), when I can
use the Perl-syntax I am familiar with, by using Mason.

That is why I use Catalyst::View::Mason.


There is, of course, the risk of abusing the power of Perl, in
Mason-components - with more power comes more responsibility¹.


(I am biased by previously having used Mason as "the whole system" for
building some websites, and (ab)using it for "just templating" in a
larger system - so I knew Mason - and made a lot of mistakes with/in
it - before I got to know Catalyst).


  Best regards,

 Adam


¹ My apologies to Yoda :-)

-- 
 "This reporter was clearly from the "stenography"Adam Sjøgren
  school of reporting. Math is hard, let's go shopping."  [EMAIL PROTECTED]

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] template comparison (was: why not mason (was: somethingelse unrelated))

2006-10-27 Thread Ash Berlin

And the prize for FotW goes to:

Joe Landman

All joking aside, I couldn't agree more - not that i know that first 
thing about Masonic rituals, er. Mason. As to my reason why I think more 
people mention TT, its because the Tutorial shows how to use TT, so if 
you don't know of anything else, why look if TT does what you need?


(Thats a subtle hint saying maybe someone should contribute a Mason 
section to the tutorial just so people don't get the idea that Catalyst 
has to use TT)


/me fans the flames

Ash

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] template comparison (was: why not mason (was: somethingelse unrelated))

2006-10-27 Thread Joe Landman
I've ignored this for the most part until here ...

Alan Humphrey wrote:
> 
> -Original Message-
> From: Jonathan Rockway [mailto:[EMAIL PROTECTED] 
> Sent: Friday, October 27, 2006 11:03 AM
> To: The elegant MVC web framework
> Subject: [Catalyst] template comparison (was: why not mason (was:
> somethingelse unrelated))
> 
> Max Afonov wrote:
>> Why don't I _ever_ hear about Mason on this list? How is TT better than
>> Mason anyway?
>>
>> ...not meaning to start a flame war...
> 
> Mostly because mason becomes an unreadable mess, just like PHP.  Take a

???  This comment makes sense for PHP, not Mason.

> look at the RT source code, or my clever example here:
> 
> Mason:
> 
> <% my $sth = $dbh->prepare('SELECT columns FROM table WHERE
> something=1'); for($row = $sth->fetchrow_arrayref){ %>

Ahh...  Apples

> 
> 
> TT (in Cat with DBIC):
> 
> 
> [% WHILE (row = rows.next) %]
> 
>   [% row.name | html %][% row.whatever | html %]
> 
> [% END %]
> 

and oranges... I get it.

If this is they way you write your views in Mason, you have larger
problems to deal with.

> 
> [Alan Humphrey] ---
> c'mon now.  Be fair in your comparisons.  Wouldn't the Mason/Cat/DBIC
> example look something like:
> 
> 
> % while (my $row = $rows->next()) {
> 
> <% $row->name %><% $row->whatever %>
> 
> % }
>  

yes, this is more apples to apples, and it looks and feels quite a bit
more Perl-ish to me than TT.

> I agree that Mason templates can become a mess, but they don't have to.  And
> there's something to be said for working in a language you know (Perl) in
> lieu of learning another (TT).

Yes.  You can make a mess out of any language, maxi or mini.

I use Catalyst::View::Mason after migrating from pure Mason for our apps
in large part due to a) the ease of developing applications in Perl (and
hence Mason), b) that I am already familar with Mason.

No one wants/needs a flame war over templating, and frankly it is quite
silly.  Sort of a "which langauge is better" argument.  Doesn't mean
much and pisses off people who should be doing more productive things.

FWIW: our commercial app frontends are developed in Mason.  Our next
generation app frontends will be in Catalyst + Mason views.  I see no
reason to change this, it gives us maximal flexibility, and we can write
in exactly one language.

Had we been a TT shop before, we probably would have done TT.  Had we
been neither, and just researching it, my preference would have been
towards Mason due to what I perceive as its strengths.

The point of this being a) Catalyst is sufficiently powerful that you
can use whatever you are most comfortable with as a view.  Mason, TT,
HTML::Template, Embperl, ClearSilver, PHP, Petal, ... b) as a result of
its power and flexibility, you have clear choices.  You can even mix and
match   if this is really a good idea is left to others .


Joe

-- 
Joe Landman
landman |at| scalableinformatics |dot| com

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: template comparison (was: why not mason (was: something else unrelated))

2006-10-27 Thread A. Pagaltzis
* Jonathan Rockway <[EMAIL PROTECTED]> [2006-10-27 20:10]:
> Mostly because mason becomes an unreadable mess, just like PHP.
> Take a look at the RT source code, or my clever example here:
> 
> Mason:
> 
> <% my $sth = $dbh->prepare('SELECT columns FROM table WHERE
> something=1'); for($row = $sth->fetchrow_arrayref){ %>

Why aren’t you presuming Catalyst::View::Mason and using a $rows
passed in from outside? This ain’t an apples-to-apples comparison
otherwise.

> TT (in Cat with DBIC):
> 
> 
> [% WHILE (row = rows.next) %]
> 
>   [% row.name | html %][% row.whatever | html %]
> 
> [% END %]
> 
> 
> ClearSilver (with some preparation in the view):
> 
> 
> 
> 
> 
> 
> 



This is the row name
The row’s whatever



That’s TAL. My, is it readable.

> TT definitely lets you write bad code too, but [% EVAL %] is
> off by default (and hence I omitted it in my example).

You don’t need EVAL to write complex logic in TT. The builtin
minilanguage is perfectly sufficient for that – of course, since
its grammar is arbitarily limited and non-orthogonal and the
language is missing many abstractions, the result ends up looking
even more hideous than if you’d used a real language in the first
place.

> Pick the system you like, but be aware of the problems that PHP
> and Mason encourage.

My theory is that those systems encourage problems because they
do not hit the 80-18-2 mark[1]: a template is 80% static strings,
18% trivial logic like the examples you gave above, and 2% hairy
annoying display logic, usually when the template has to deal
with some non-predigested data structure. (If you predigest the
data structure, you’re just leaking display logic back into the
business logic.)

PHP and Mason fail in the ways you describe because they use
their provision for the 2% to also cover the 18% needs, thus
encouraging overuse of its power.

TT2 provides a single minilanguage for both, which is
unnecessarily powerful and verbose for the 18% and way
underpowered for the 2%.

TAL has the *perfect* syntax to cover the 18%, but leaves you
high and dry with the 2%.

They all suck, but at this point I hate TT2’s neither-fish-nor-
fowl approach more than any of them. TT2 has many things to
commend it, but its language is not of them.

None of these engines provides a separate concise syntax to cover
the 18% AND the power of a *real* language to cover the 2%.

I posit that having a real language available in templates would
not lead to problems if an alternative syntax were available that
was much easier to use for trivial display logic than firing up
the Turing-complete gun.


[1]: I pulled those numbers out of somewhere, purely on the basis
 that the combination should flow well as prose.

Regards,
-- 
Aristotle Pagaltzis // 

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread John Wang
On 10/27/06, Max Afonov <[EMAIL PROTECTED]> wrote:
Why don't I _ever_ hear about Mason on this list?It does come up and there are people using Mason with Catalyst. As for why Mason may be mentioned less than TT, it could simply be that Cat+Mason users have fewere questions ;)
 How is TT better than Mason anyway?That's subjective and a lot if it comes down to your preferences. I use TT because it's lighter weight and I haven't felt the need for more capabilities. Previously I used HTML::Template and did want more capabilities so I moved up to TT.
-- John Wanghttp://www.dev411.com/blog/
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Perrin Harkins
On Fri, 2006-10-27 at 13:14 -0400, Max Afonov wrote:
> Why don't I _ever_ hear about Mason on this list?

Possibly because if you already use Mason, you don't have much use for
Catalyst, and vice versa?  There's a lot of overlap in functionality
between the two, especially in terms of controller duties.  Also, Mason
is heavier and slower than other choices if you all you're using it for
is templates.

> How is TT better than Mason anyway?

The primary differences are that TT is "just templates" instead of a
whole web framework like Mason, and TT uses a simplified mini-language
rather than in-line Perl.  Whether those things sound good to you or not
determines which one you will prefer.

- Perrin


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] template comparison

2006-10-27 Thread Max Afonov
There's no doubt about that. Bad design can turn any project into a 
horrible quagmire. One can even treat Catalyst as a glorified CGI.pm and 
never really use any of the MVC goodness. And don't even get me started 
on TT having a whole different syntax, one that could be easier taught 
to web designers, but also one that has to co-exist alongside Perl. 
Forget the syntax though, it's not just that... It's another level of 
complexity in a stack of technologies that already provide for a complex 
system without another layer.


Jonathan Rockway wrote:

Max Afonov wrote:
  

This just isn't true. First and foremost, why does your Mason template
even think about considering direct usage of DBI? In a  tag? With
a raw SQL query? Can't one set $c->stash->{rowset} to whatever DBIC
returns, and then declare:

<%args>
   $rowset


Suddenly, the $rowset is available in your template without you having
to fetch it manually. Or you could just use $c directly since it's set
up as a global variable, at least when you're inheriting from
C::V::Mason anyway.



I'm just saying this is the sort of thing I've observed in real life.  YMMV.

  



MLB.com: Where Baseball is Always On



___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] template comparison (was: why not mason (was: somethingelse unrelated))

2006-10-27 Thread Alan Humphrey


-Original Message-
From: Jonathan Rockway [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 27, 2006 11:03 AM
To: The elegant MVC web framework
Subject: [Catalyst] template comparison (was: why not mason (was:
somethingelse unrelated))

Max Afonov wrote:
> Why don't I _ever_ hear about Mason on this list? How is TT better than
> Mason anyway?
> 
> ...not meaning to start a flame war...

Mostly because mason becomes an unreadable mess, just like PHP.  Take a
look at the RT source code, or my clever example here:

Mason:

<% my $sth = $dbh->prepare('SELECT columns FROM table WHERE
something=1'); for($row = $sth->fetchrow_arrayref){ %>


TT (in Cat with DBIC):


[% WHILE (row = rows.next) %]

  [% row.name | html %][% row.whatever | html %]

[% END %]


[Alan Humphrey] ---
c'mon now.  Be fair in your comparisons.  Wouldn't the Mason/Cat/DBIC
example look something like:


% while (my $row = $rows->next()) {

<% $row->name %><% $row->whatever %>

% }
 

I agree that Mason templates can become a mess, but they don't have to.  And
there's something to be said for working in a language you know (Perl) in
lieu of learning another (TT).


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] template comparison

2006-10-27 Thread Jonathan Rockway
Max Afonov wrote:
> This just isn't true. First and foremost, why does your Mason template
> even think about considering direct usage of DBI? In a  tag? With
> a raw SQL query? Can't one set $c->stash->{rowset} to whatever DBIC
> returns, and then declare:
> 
> <%args>
>$rowset
> 
> 
> Suddenly, the $rowset is available in your template without you having
> to fetch it manually. Or you could just use $c directly since it's set
> up as a global variable, at least when you're inheriting from
> C::V::Mason anyway.

I'm just saying this is the sort of thing I've observed in real life.  YMMV.

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] template comparison (was: why not mason

2006-10-27 Thread Max Afonov
This just isn't true. First and foremost, why does your Mason template 
even think about considering direct usage of DBI? In a  tag? With 
a raw SQL query? Can't one set $c->stash->{rowset} to whatever DBIC 
returns, and then declare:


<%args>
   $rowset


Suddenly, the $rowset is available in your template without you having 
to fetch it manually. Or you could just use $c directly since it's set 
up as a global variable, at least when you're inheriting from 
C::V::Mason anyway.


This is not to say that I've seen apps written entirely in Mason so that 
Mason bears the duties of the model, view, and controller, all at the 
same time. Catalyst, however, gives us the ability to relieve it of any 
extra duties outside of pure display of data.


Jonathan Rockway wrote:

Max Afonov wrote:
  

Why don't I _ever_ hear about Mason on this list? How is TT better than
Mason anyway?

...not meaning to start a flame war...



Mostly because mason becomes an unreadable mess, just like PHP.  Take a
look at the RT source code, or my clever example here:

Mason:

<% my $sth = $dbh->prepare('SELECT columns FROM table WHERE
something=1'); for($row = $sth->fetchrow_arrayref){ %>

That Other Language:

". $row['0']. "". $row['1']. ""; }
?>

TT (in Cat with DBIC):


[% WHILE (row = rows.next) %]

  [% row.name | html %][% row.whatever | html %]

[% END %]


ClearSilver (with some preparation in the view):








Mason and PHP are both fine tools, but they are a little too flexible.
If you want web designers to be able to work on your templates, then you
can't have "print" statements in your template.  If you want your code
to be maintainable, you can't prepare your database queries in the
template.  Mason and PHP degenerate to things like the above example
because it's really easy to let happen.  (Look at the RT source.  Good
people working on it.  Completely useless templates.)

TT definitely lets you write bad code too, but [% EVAL %] is off by
default (and hence I omitted it in my example).  ClearSilver ensures
that you don't do anything code-wise in your templates, at the cost of
not being able to do anything code-wise in your templates :)

Pick the system you like, but be aware of the problems that PHP and
Mason encourage.

Regards,

  



MLB.com: Where Baseball is Always On



___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] template comparison (was: why not mason (was: something else unrelated))

2006-10-27 Thread Jonathan Rockway
Max Afonov wrote:
> Why don't I _ever_ hear about Mason on this list? How is TT better than
> Mason anyway?
> 
> ...not meaning to start a flame war...

Mostly because mason becomes an unreadable mess, just like PHP.  Take a
look at the RT source code, or my clever example here:

Mason:

<% my $sth = $dbh->prepare('SELECT columns FROM table WHERE
something=1'); for($row = $sth->fetchrow_arrayref){ %>

That Other Language:

". $row['0']. "". $row['1']. ""; }
?>

TT (in Cat with DBIC):


[% WHILE (row = rows.next) %]

  [% row.name | html %][% row.whatever | html %]

[% END %]


ClearSilver (with some preparation in the view):








Mason and PHP are both fine tools, but they are a little too flexible.
If you want web designers to be able to work on your templates, then you
can't have "print" statements in your template.  If you want your code
to be maintainable, you can't prepare your database queries in the
template.  Mason and PHP degenerate to things like the above example
because it's really easy to let happen.  (Look at the RT source.  Good
people working on it.  Completely useless templates.)

TT definitely lets you write bad code too, but [% EVAL %] is off by
default (and hence I omitted it in my example).  ClearSilver ensures
that you don't do anything code-wise in your templates, at the cost of
not being able to do anything code-wise in your templates :)

Pick the system you like, but be aware of the problems that PHP and
Mason encourage.

Regards,

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Krzysztof Krzyżaniak
Jonathan Rockway <[EMAIL PROTECTED]> writes:

>> TT. Mostly beacuse I have access to catalyst context here. I've tried to
>> use ClearSilver but it was too simple for me (almost every controller
>> needed additional 10-20 lines of code).
>
> Keep in mind that although ClearSilver isn't as syntactically
> expressive, it is *much* faster.  There's a reason Google and Yahoo use
> ClearSilver and not TT.
>
> But, you don't need to add code to your controller to handle the
> formatting -- that should be in the view.  This will give you more
> flexibility in the end.  You can write maintainable, testable formatters
> in Perl as your View and let ClearSilver handle the tough bit of
> actually inserting strings into HTML.

I don't mean formatting, I mean that I cannot use in ClearSilver something 
like that:

[% IF (c.user.obj.id == article.data.account_id) %]

or 



because I don't have access to context. I have to "map" all method I need
in stash.

> I like the convenience of TT myself, but I think ClearSilver + perl
> preprocessor is the Right Way To Do Things, if that matters :)

Maybe. But somehow I like to have more information than 'parse error' when
I prepare template :>

  eloy
-- 
[EMAIL PROTECTED]

   jak to dobrze, że są oceany - bez nich byłoby jeszcze smutniej

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Max Afonov
Why don't I _ever_ hear about Mason on this list? How is TT better than 
Mason anyway?


...not meaning to start a flame war...

Perrin Harkins wrote:

On Fri, 2006-10-27 at 11:41 -0500, [EMAIL PROTECTED] wrote:
  

I guess:  s/Google and Yahoo use ClearSilver and not TT./Google uses
ClearSilver and Yahoo is no where near #1 in search (php)./



The only thing I see mention of Google using it for is "Google Groups",
their Usenet thing.  Yahoo gets massive amounts of traffic.  They get
orders of magnitude more hits than a typical popular website.

All I'm saying is that the speed of the current crop of templating tools
for Perl is unlikely to be the thing holding you back from building a
scalable site.  TT is plenty fast enough, if you don't try to wedge a
bunch of controller logic into it.  But if you prefer the syntax of
ClearSilver, then go ahead and use it.

- Perrin


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

  



MLB.com: Where Baseball is Always On



___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Perrin Harkins
On Fri, 2006-10-27 at 11:41 -0500, [EMAIL PROTECTED] wrote:
> I guess:  s/Google and Yahoo use ClearSilver and not TT./Google uses
> ClearSilver and Yahoo is no where near #1 in search (php)./

The only thing I see mention of Google using it for is "Google Groups",
their Usenet thing.  Yahoo gets massive amounts of traffic.  They get
orders of magnitude more hits than a typical popular website.

All I'm saying is that the speed of the current crop of templating tools
for Perl is unlikely to be the thing holding you back from building a
scalable site.  TT is plenty fast enough, if you don't try to wedge a
bunch of controller logic into it.  But if you prefer the syntax of
ClearSilver, then go ahead and use it.

- Perrin


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Wade . Stuart






Perrin Harkins <[EMAIL PROTECTED]> wrote on 10/27/2006 11:26:14 AM:

> On Fri, 2006-10-27 at 10:56 -0500, Jonathan Rockway wrote:
> > Keep in mind that although ClearSilver isn't as syntactically
> > expressive, it is *much* faster.  There's a reason Google and Yahoo use
> > ClearSilver and not TT.
>
> I had lunch with Rasmus Lerdorf at ApacheCon a couple weeks ago and he
> told me Yahoo has dropped ClearSilver from nearly all of their apps, and
> intends to drop it from the rest.  They use PHP for their live
> templating now.
>
> - Perrin

I guess:  s/Google and Yahoo use ClearSilver and not TT./Google uses
ClearSilver and Yahoo is no where near #1 in search (php)./


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Perrin Harkins
On Fri, 2006-10-27 at 10:56 -0500, Jonathan Rockway wrote:
> Keep in mind that although ClearSilver isn't as syntactically
> expressive, it is *much* faster.  There's a reason Google and Yahoo use
> ClearSilver and not TT.

I had lunch with Rasmus Lerdorf at ApacheCon a couple weeks ago and he
told me Yahoo has dropped ClearSilver from nearly all of their apps, and
intends to drop it from the rest.  They use PHP for their live
templating now.

- Perrin


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: How to redirect before some code excute

2006-10-27 Thread Eden Cardim

On 10/26/06, Fayland Lam <[EMAIL PROTECTED]> wrote:

Matt S Trout wrote:
> Fayland Lam wrote:
>> Lee Standen wrote:
>>> It's a subroutine, right?
>>>
>>> Tried a return?such as:
>>>
>>> $c->res->redirect('http://www.yahoo.com');
>>> return undef;
>>
>> Indeed I want to run the 'while' loop in backend. 'return' would not
>> run the loop I think.
>
> $c->res->redirect(...);
> $c->finalize_headers;
>
> 
>
> might do the trick
>

no, it doesn't work. maybe there is something concerned with 'butter',
it's not sent immediately.
and I use mod_perl2, so I'd like to have a try of system.
Thanks any way.


It works if you manage to run your stuff after Catalyst calls
$c->finalize() in handle_request(). Funny, I just wrote a hack, err,
plugin yesterday which gives me the option to set up a hook that's
called right after $c->finalize(). I'm not sure if this is the correct
way to do it or if there are any side-effects, if any of the more
experient Catalyst users/developers think its a good idea for a
plugin, let me know and I'll can carve it up and release it.
I use mod_perl and haven't had any trouble so far, this approach lets
me delegate all the pre-fork management to apache. I have a Catalyst
front-end which adds jobs to a queue like mentioned before in the
thread and a another Catalyst server running XMLRPC that gets notified
about incoming jobs and runs them after responding to the XMLRPC
notification.

In MyApp.pm:
use Catalyst qw/AfterFinalize/;

In a controller action somewhere:
sub myaction : Local {
   $c->res->body('running job');
   $c->after_finalize(sub { run_job() } );
}

--
Eden Cardim
Instituto Baiano de Biotecnologia
Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas
Laboratório de Bioinformática
--
"you seem to think that 'close enough' is close enough...
please learn to be 'literal' around programming."
merlyn - on irc.freenode.net#perl


AfterFinalize.pm
Description: Perl program
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Jonathan Rockway

> TT. Mostly beacuse I have access to catalyst context here. I've tried to
> use ClearSilver but it was too simple for me (almost every controller
> needed additional 10-20 lines of code).

Keep in mind that although ClearSilver isn't as syntactically
expressive, it is *much* faster.  There's a reason Google and Yahoo use
ClearSilver and not TT.

But, you don't need to add code to your controller to handle the
formatting -- that should be in the view.  This will give you more
flexibility in the end.  You can write maintainable, testable formatters
in Perl as your View and let ClearSilver handle the tough bit of
actually inserting strings into HTML.

I like the convenience of TT myself, but I think ClearSilver + perl
preprocessor is the Right Way To Do Things, if that matters :)

Regards,
Jonathan Rockway

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] (Beginner) Plugins

2006-10-27 Thread Alejandro Imass
Thank you very much! I haven't used Windoze for a long time so I wasn't
even aware of the fact until I tried to demo my first take on this site
to the client, you can imagine the disaster!On 10/24/06, Nilson Santos Figueiredo Junior <[EMAIL PROTECTED]> wrote:
On 10/24/06, Alejandro Imass <[EMAIL PROTECTED]
> wrote:>  MS IE does not support transparency on PNGs and GIF would mess up the fade> badly.Actually IE does support PNG transparency. You just need to coerce itinto supporting it. ;-)
Google for "IE PNG Transparency" and the first results should be useful.-Nilson Santos F. Jr.___List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalystSearchable archive: 
http://www.mail-archive.com/catalyst@lists.rawmode.org/Dev site: http://dev.catalyst.perl.org/
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Missing Helper.pm

2006-10-27 Thread catalyst . 20 . chsg

Yep.  That fixed it.  Thanks.


On 10/26/06, Jesse Sheidlower - [EMAIL PROTECTED]  wrote:

On Thu, Oct 26, 2006 at 11:55:37AM -0400, [EMAIL PROTECTED] wrote:
> I've done a couple of Catalyst installs in the last few days, one on
> OS X and one on Ubuntu Linux, both using the cat-install script.
>
> The installs seemed to go fine, but when I run "catalyst.pl MyApp" I
> get this error:
>
> Can't locate Catalyst/Helper.pm in @INC (@INC contains: /etc/perl
> /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5
> /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
> /usr/local/lib/site_perl .) at /usr/bin/catalyst.pl line 24.
> BEGIN failed--compilation aborted at /usr/bin/catalyst.pl line 24.
>
>
> I've search high and low on the machines looking for Helper.pm, but it
> does not exist.
>
> Any suggestions?

You need to install Catalyst::Devel separately. The cat-install
script doesn't install this itself.

Jesse Sheidlower

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/



___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Krzysztof Krzyżaniak
"Hermida, Leandro" <[EMAIL PROTECTED]> writes:

> Hello,
>
>>
>> I'd never used TT, so you might be even more at home.
>>
>
> I have been trying to decide what is the best 'View' to use with
> Catalyst and it is so difficult to get an up-to-date comparison that I
> can understand of the main views available for Perl (TT, Mason,
> others?).  
>
> I know this is a loaded question also, but I would like to ask the
> Catalyst users out there as to what 'View' are you using?

TT. Mostly beacuse I have access to catalyst context here. I've tried to
use ClearSilver but it was too simple for me (almost every controller
needed additional 10-20 lines of code).

> I need something that is powerful, comprehensive, flexible and capable
> of generating highly dynamic database-centic web pages whose
> display/presentation can be controlled by meta data also in the
> database.  Being very new to the approach I see in systems like TT and
> Mason I guess I have to say I feel awkward because they seem to use the
> approach of embedding dynamic pseudocode into static HTML versus what I
> am used which is to use all Perl code to build the dynamic HTML in a
> string and then injecting it into the dynamic container areas I have
> defined in my app HTML template.

so ClearSilver would be probably good for you.

  eloy
-- 
[EMAIL PROTECTED]

   jak to dobrze, że są oceany - bez nich byłoby jeszcze smutniej

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Daniel McBrearty

solve the problem you have today ...


On 10/27/06, Marcello Romani <[EMAIL PROTECTED]> wrote:

Jeremiah Foster ha scritto:
> Hi there,
>
> I discovered catalyst while looking for a simple JavaScript code snippet
> to activate a checkbox immediately. I read a bit on cpan and Catalyst
> seems to use some of my favorite perl glue, like DBI, CGI, and Template
> toolkit.
>
> But do I want a full blown framework?
>
> Or do I just want a simple JavaScript function?


--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Hermida, Leandro

Hello,

>
> I'd never used TT, so you might be even more at home.
>

I have been trying to decide what is the best 'View' to use with
Catalyst and it is so difficult to get an up-to-date comparison that I
can understand of the main views available for Perl (TT, Mason,
others?).  

I know this is a loaded question also, but I would like to ask the
Catalyst users out there as to what 'View' are you using?

I need something that is powerful, comprehensive, flexible and capable
of generating highly dynamic database-centic web pages whose
display/presentation can be controlled by meta data also in the
database.  Being very new to the approach I see in systems like TT and
Mason I guess I have to say I feel awkward because they seem to use the
approach of embedding dynamic pseudocode into static HTML versus what I
am used which is to use all Perl code to build the dynamic HTML in a
string and then injecting it into the dynamic container areas I have
defined in my app HTML template.

Thank you,

Leandro


-Original Message-
From: JT Justman [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 27, 2006 11:06
To: [EMAIL PROTECTED]; The elegant MVC web framework
Subject: Re: [Catalyst] Is Catalyst what I want?

Jeremiah Foster wrote:
> Hi there,
> 
> I discovered catalyst while looking for a simple JavaScript code 
> snippet to activate a checkbox immediately. I read a bit on cpan and 
> Catalyst seems to use some of my favorite perl glue, like DBI, CGI, 
> and Template toolkit.
> 
> But do I want a full blown framework?
> 
> Or do I just want a simple JavaScript function?
> 
> I hope that those of you who have a bit of experience with both might 
> reply and advise me on the right course of action.
> 

He he. That sounds rather like going to the hardware store for a pack of
tumbtacks and coming home with a pneumatic staple gun, 10hp air
compressor, twenty-foot scaffolding, and four cases of #1 zinc-coated
staples.

Seriously though, what are you trying to do? There's a lot of reasons to
use a framework, and a lot of reasons that Catalyst is a great
framework, but repeating them in this thread seems redundant. My
personal experience, having previously spent a lot of time 'rolling my
own', Catalyst was a breath of fresh air. There is a bit of a learning
curve, but I've never felt better about the apps I'm producing. I'd
never used TT, so you might be even more at home.

But if you're telling us that you have a mature app with one small
issue, and want to know if you should port it over to fix it, I'll say
probably not ;P

JT

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Marcello Romani

Jeremiah Foster ha scritto:

Hi there,

I discovered catalyst while looking for a simple JavaScript code snippet
to activate a checkbox immediately. I read a bit on cpan and Catalyst
seems to use some of my favorite perl glue, like DBI, CGI, and Template
toolkit. 


But do I want a full blown framework?

Or do I just want a simple JavaScript function?


So the question is how do I immediately (?) activate a checkbox ? Using 
a javascript function or a full-blown perl web framework ?

The answer seems pretty obvious to me :-)

OTOH, if that small issue is to become an excuse for entering the world 
of Catalyst, then maybe it's worth trying to solve it with Cat!




I hope that those of you who have a bit of experience with both might
reply and advise me on the right course of action.

Thank you.



--
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread Kieren Diment
On 27/10/06, Jeremiah Foster <[EMAIL PROTECTED]> wrote:
Hi there,I discovered catalyst while looking for a simple _javascript_ code snippetto activate a checkbox immediately. I read a bit on cpan and Catalystseems to use some of my favorite perl glue, like DBI, CGI, and Template
toolkit.But do I want a full blown framework?Or do I just want a simple _javascript_ function?I hope that those of you who have a bit of experience with both mightreply and advise me on the right course of action.
Umm, if you want to do a small one off thing, you don't want catalyst.  If you want to do something a bit more on the lines of web-application infrastructure, then maybe you do want catalyst.
You haven't really provided enough information to answer your question properly.
___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Is Catalyst what I want?

2006-10-27 Thread JT Justman
Jeremiah Foster wrote:
> Hi there,
> 
> I discovered catalyst while looking for a simple JavaScript code snippet
> to activate a checkbox immediately. I read a bit on cpan and Catalyst
> seems to use some of my favorite perl glue, like DBI, CGI, and Template
> toolkit. 
> 
> But do I want a full blown framework?
> 
> Or do I just want a simple JavaScript function?
> 
> I hope that those of you who have a bit of experience with both might
> reply and advise me on the right course of action.
> 

He he. That sounds rather like going to the hardware store for a pack of
tumbtacks and coming home with a pneumatic staple gun, 10hp air
compressor, twenty-foot scaffolding, and four cases of #1 zinc-coated
staples.

Seriously though, what are you trying to do? There's a lot of reasons to
use a framework, and a lot of reasons that Catalyst is a great
framework, but repeating them in this thread seems redundant. My
personal experience, having previously spent a lot of time 'rolling my
own', Catalyst was a breath of fresh air. There is a bit of a learning
curve, but I've never felt better about the apps I'm producing. I'd
never used TT, so you might be even more at home.

But if you're telling us that you have a mature app with one small
issue, and want to know if you should port it over to fix it, I'll say
probably not ;P

JT

___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Is Catalyst what I want?

2006-10-27 Thread Jeremiah Foster
Hi there,

I discovered catalyst while looking for a simple JavaScript code snippet
to activate a checkbox immediately. I read a bit on cpan and Catalyst
seems to use some of my favorite perl glue, like DBI, CGI, and Template
toolkit. 

But do I want a full blown framework?

Or do I just want a simple JavaScript function?

I hope that those of you who have a bit of experience with both might
reply and advise me on the right course of action.

Thank you.

-- 
Jeremiah Foster 
---
e. [EMAIL PROTECTED]
w. http://devmodul.com


___
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/