Re: [Catalyst] UTF-8 and mails
From: Jens Schwarz blacky6...@gmx.de Hi, first of all: I have read http://dev.catalystframework.org/wiki/tutorialsandhowtos/Using_Unicode (especially the Tips for Troubleshooting Unicode in Perl Web Applications) Nevertheless I have a strange UTF-8 problem that I need help with: Concerning UTF-8 everything in my App seems to work correct - except my mail action (I use Mail::Sender::Easy) in my Root controller: Try using Mail::Builder::Simple for sending UTF-8 encoded email messages (headers and body). Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Page fragment caching
From: Tobias Kremer tobias.kre...@gmail.com Meanwhile, I played with Template::Plugin::Cache which unfortunately has problems with UTF-8 content and Memcached because the UTF-8 flag is not properly restored on get(). Should be easy to fix with something like: Encode::_utf8_on( $result ); The author of T::P::Cache said that this bug is solved if instead of Cache is used a CHI object. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Format last modified date field ...
From: J. Shirley jshir...@gmail.com On Mon, Dec 28, 2009 at 1:17 PM, Kiffin Gish kiffin.g...@planet.nl wrote: I'm using a last_modified field which is being displayed like this 2009-12-28T18:25:28 (what's that 'T' doing in there?) but want to use a different format, how? In the list.tt2 file for listing users, I have: [% WHILE (user = users_rs.next) -%] [% FOREACH col IN users_rs.result_source.columns -%] [% user.$col %]/td [% END %] [% END -%] In the schema Users: __PACKAGE__-load_components(InflateColumn::DateTime, TimeStamp, Core); __PACKAGE__-table(users); __PACKAGE__-add_columns( ... last_modified, { data_type = DATETIME, default_value = undef, is_nullable = 1, size = undef, }, ); Thanks alot in advance. -- Kiffin Gish kiffin.g...@planet.nl Gouda, The Netherlands This recipe is a bit premature to release, and I've been meaning to for a while but I am happy with it and it works well enough for me. I had to rip out some other bits, so it may not compile right out. I posted the gist here: http://gist.github.com/264994 The general idea is that in View::TT configuration, I define whatever formats I want. Then in TT, if I have a date I just use the [% date_whatever | date_long %] Anything in the date group creates a filter called date_long or date_whatever. I have used this to create a lot of various template filters that are sourced by config, though. Feedback welcome, I'll build a blog entry and cross-post to the wiki after I clean it up. -J I use a template which is included automaticly in each template, and I defined more macros in it, one that formats a DateTime column taking only the date, one that gets the time also, one that also prints the name of the week day, one that prints only the time, and other macros that formats a date string, not a DateTime object, and I can use any of those macros, depending on the result I want. (I also defined here the macro which is used for localizing the strings in all the templates.) In order to include this template automaticly in each template, I use in the app config: 'View::TT' = { PRE_PROCESS = ['locale_date_datetime.tt'], }, Where locale_date_datetime.tt is the name of the template which is included below. And it can be used like: [% WHILE (row = table_name.next) -%] [% d(row.date) %] [% END -%] Here is the content of this template: [% #From a DateTime object: 23 feb. 2009 ~%] [% MACRO d(date) BLOCK; date.set_locale(language).strftime('%e %b %Y');END ~%] [% #From a string with DateTime: 23 feb. 2009 ~%] [% MACRO d2(date) BLOCK; USE dt = DateTime(from_string = date, pattern = '%Y-%m-%d', time_zone = 'Europe/Bucharest'); dt.set_locale(language).strftime('%e %b %Y');END ~%] [% #From a DateTime object: 23 feb. 2009 14:30 ~%] [% MACRO dt(date) BLOCK; date.set_locale(language).strftime('%e %b %Y %H:%M');END ~%] [% #From a string with DateTime: 23 feb. 2009 14:30 ~%] [% MACRO dt2(date) BLOCK; USE dt = DateTime(from_string = date, pattern = '%Y-%m-%d %H:%M:%S', time_zone = 'Europe/Bucharest'); dt.set_locale(language).strftime('%A, %e %B %Y %H:%M');END ~%] [% #From a DateTime object: marti, 23 februarie 2009 14:30 ~%] [% MACRO dtd(date) BLOCK; date.set_locale(language).strftime('%A, %e %B %Y %H:%M');END ~%] [% #From a string with DateTime: marti, 23 februarie 2009 14:30 ~%] [% MACRO dtd2(date) BLOCK; USE dt = DateTime(from_string = date, pattern = '%Y-%m-%d %H:%M:%S', time_zone = 'Europe/Bucharest'); dt.set_locale(language).strftime('%A, %e %B %Y %H:%M');END ~%] [% #From a string with Date: marti, 23 februarie 2009 14:30 ~%] [% MACRO dtd3(date) BLOCK; USE dt = date; dt.format(date, '%A, %d %B %Y %H:%M', lang);END ~%] [% #From a DateTime object: 14:30 ~%] [% MACRO t(date_time) BLOCK; date_time.set_locale(language).strftime('%H:%M');END ~%] [% #translation ~%] [% MACRO l(text,args) BLOCK; c.localize(text,args) || text; END ~%] Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Apache + mod_perl + Digest-SHA fails
From: Tomas Doran bobtf...@bobtfish.net On 16 Dec 2009, at 22:16, Octavian Râsnita wrote: Using fastcgi under Windows is harder, and I don't even know if it can run as an ExternalServer. Yes, it totally can, however not on a local socket tcp-ip only. I thought I need to install FCGI::ProcManager in order to use fastcgi. I wasn't able to install this module under Windows, although I tried with both ActivePerl and Strawberry Perl. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Q: DBIC transaction around Catalyst action chain
From: Bernhard Graf cataly...@augensalat.de Hi, having all database access of a Cat action in a database transaction is easy: Wrap everything in $c-model('DB')-schema-txn_do(...) or use Catalyst::Action::DBIC::Transaction. But what to do with action chains? Read about txn_begin and txn_commit at: http://search.cpan.org/~frew/DBIx-Class-0.08114/lib/DBIx/Class/Storage.pm#txn_begin Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [ANNOUNCE] Catalyst-Runtime 5.80015
From: Tomas Doran bobtf...@bobtfish.net Hiya. I'm pleased to announce a new stable release of Catalyst-Runtime (5.80015). This release mainly wraps up the new features and bugfixes previewed in 5.80014_01 and 5.80014_02. I've tried to install it under Windows XP Pro, and it gave the following error: E:\perl510\cpan\build\Catalyst-Runtime-5.80015-pdAEnAprove -l t/aggregate/utf8_content_length.t t/aggregate/utf8_content_length.t .. 1/? # Failed test '/binary correct content length' # at t/aggregate/utf8_content_length.t line 21. # got: '5700' # expected: '5701' # Failed test '/binary_utf8 correct content length' # at t/aggregate/utf8_content_length.t line 26. # got: '5700' # expected: '5701' # Looks like you failed 2 tests of 6. t/aggregate/utf8_content_length.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/6 subtests Test Summary Report --- t/aggregate/utf8_content_length.t (Wstat: 512 Tests: 6 Failed: 2) Failed tests: 3, 6 Non-zero exit status: 2 Files=1, Tests=6, 0 wallclock secs ( 0.01 usr + 0.01 sys = 0.03 CPU) Result: FAIL E:\perl510\cpan\build\Catalyst-Runtime-5.80015-pdAEnA HTH. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [ANNOUNCE] Catalyst-Runtime 5.80015
From: Tomas Doran bobtf...@bobtfish.net Hiya. I'm pleased to announce a new stable release of Catalyst-Runtime (5.80015). This release mainly wraps up the new features and bugfixes previewed in 5.80014_01 and 5.80014_02. I've tried to install it under Windows XP Pro, and it gave the following error: Interesting, especially as it's off by 1 byte only. But I need some more details to be able to get anywhere with this. Specifically: What perl build you have, your perl -V and what version of Encode.pm you have. I have Encode v 2.39 and: This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 5 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 1004 [287188] provided by ActiveState http://www.ActiveState.com Built Sep 3 2008 13:16:37 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using man perl or perldoc perl. If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=MSWin32, osvers=5.00, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLIB_LAST_IN_INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='12.0.8804', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags '-nologo -nodefaultlib -debug -opt:ref,icf -libpath:E:\perl510\lib\CORE -machine:x86' libpth=\lib libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl510.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:E:\perl510\lib\CORE -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_SITECUSTOMIZE Locally applied patches: ActivePerl Build 1004 [287188] 33741 avoids segfaults invoking S_raise_signal() (on Linux) 33763 Win32 process ids can have more than 16 bits 32809 Load 'loadable object' with non-default file extension 32728 64-bit fix for Time::Local Built under MSWin32 Compiled at Sep 3 2008 13:16:37 %ENV: PERL5LIB=e:\lucru\catalyst\support\lib @INC: e:\lucru\catalyst\support\lib E:/perl510/site/lib E:/perl510/lib . If you could install CPAN::Reporter and send a proper CPAN testers report also that'd be great. I've just done it. Although the report doesn't appear for the moment on cpan.org, but here is a link to another failed report under Windows, with Perl 5.8.8, with the same error: http://www.nntp.perl.org/group/perl.cpan.testers/2009/12/msg6320756.html Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] namespace problem
From: Eden Cardim edencar...@gmail.com Andrew == Andrew Rodland and...@cleverdomain.org writes: Andrew For the sake of sanity, what you need to do is stop Andrew inheriting from a concrete controller. It really doesn't Andrew make a lot of sense and there are a lot of ways it could Andrew break something. As Moritz writes, if you need a controller Andrew base class, write a controller base class and inherit from Andrew that. Or even better, write a role instead. Is there any tutorial for using Moose roles in Catalyst? Thanks. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Re: Language selection in URLs
From: Fayland Lam fayl...@gmail.com why shouldn't you use domain as the part of the language? like en.example.com, cn.example.com and something like that? Thanks. Because each sub-domain would require another SSL key (or a special group SSL key that can be used with more subdomains. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Language selection in URLs
From: Joel Bernstein j...@fysh.org On 15 Nov 2009, at 15:06, Bill Moseley wrote: What's your preferred approach to specifying a language tag in a URL? Is there strong argument for one over the other? http://example.com/en_us/path/to/some/index.html # language prefix http://example.com/path/to/some/index.html?lang=en_us No no no! Allow the client and server to negotiate what content to serve for the resource identified. As a URI to a resource which may vary according to many dimensions, /path/to/some/content is fine. GET /path/to/content HTTP/1.1 Accept-Language: en Accept: text/html A better question is: what kind of problems are you solving where server-driven or agent-driven content negotiation as described in the HTTP 1.1 RFC (an excellent and very readable document, honestly) are insufficient? /joel The most important reason I needed to use URLS like /en/dir/file, /ro/dir/file was the fact that very many users, although they don't know English, they use the browser with the default configurations so they see the pages in English and then they don't like it and want to change it. So I use the following rules (in order) for choosing the current language: 1. The language chosen by the user by clicking the wanted flag; 2. The language which is specified in the URL like /ro/dir/file; 3. The language prefered by the browser; 4. The default language (if the site doesn't offer translation for the browser-prefered language, or if there is no browser-prefered language). Using different URLS for different pages might help search engines to index the site, because otherwise the search engines might not try to access the site with all possible languages in order to see if the web site offers content in those languages. (There may be other solutions for this, like specifying the alternate versions of the page as meta tags or something like that, but I don't know how to do that or if it is possible.) Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Language selection in URLs
From: Stephan Jauernick step...@stejau.de Hi, I would suggest you: http://search.cpan.org/~stephanj/Catalyst-TraitFor-Request-PerLanguageDomains-0.01/lib/Catalyst/TraitFor/Request/PerLanguageDomains.pm I have seen it, but it recognize the languages from the domain names and if I'd use this type of URL naming it would be harder to use an SSL key. I know that there are SSL keys that can be used for more subdomains, but I don't have one like that. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Request
From: Larry Leszczynski lar...@emailplus.org Hi Octavian - Not sure if this gets you all the way there, but you could call c.req.uri with no arguments, that should give you the current request including base, path and query string. Then you could strip off c.req.base from the beginning of that string. Thank you Larry, but the problem is that the base was overwritten and it contains some more than the uri, so I can't cut it from the URI. It should work fine, we do something very similar. The trick is that after the prepare_path fixup (if you did it like in the wiki), when you stringify c.req.uri, it will reflect the *new* base, not the original. Using your example: original request url:http://www.site.com/prg?var1=val1var2=val2 rewritten request url: http://www.site.com/en/prg?var1=val1var2=val2 So you should have: [% uri = c.req.uri; # http://www.site.com/en/prg?var1=val1var2=val2 base = c.req.base;# http://www.site.com/en/ pattern = '^' _ base;# pattern not tested... path_and_query = uri.replace(pattern, ''); %] So it's easy to strip base from the front of uri and get what you need, without knowing what base is. ** Thank you Larry. Finally I've done it this way. I didn't know that c.req.uri is not just a string, but an object that has its own methods, and c.req.uri.path_query was the one I needed. This could work, but given the same original url and prepare_path fixup, you will have: [% uri = c.req.uri; # http://www.site.com/en/prg?var1=val1var2=val2 path_and_query = c.req.uri.path_query; # /en/prg?var1=val1var2=val2 %] So now when you build the new url you have to be aware that path_and_query contains the /en part that needs to be stripped. Larry ** Oh yes, I found that so I've used the solution you proposed. Now I use the following line in prepare_path() for every request: $c-request-uri-path($language/ . $c-request-path); so the URI is always overwritten and it contains the language indicator. I had previously used that line like unless(@path_chunks $valid_languages{$path_chunks[0]}) { $c-request-uri-path($language/ . $c-request-path); } and in that case the URI wasn't containing the language indicator when the original URI was without a language indicator, but the base was always containing it. But now it seems to work fine. Thank you. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Choosing the language
From: Larry Leszczynski lar...@emailplus.org Hi (again) Octavian - Is there a recommendation for storing the language ID in the URL in order to be as easy to get it from there? I want to have unique links for each URL, so I can't just put it in the cookies. Using ?lang=EN seems to be the easiest way, although it doesn't look nice. Putting it as the first element in the path info looks nice, but I don't know how to get it from there in a single controller/action and not in every action separately. Here is one way to have it in the URL without all controllers needing to be aware: http://dev.catalyst.perl.org/wiki/wikicookbook/urlpathprefixing HTH, Larry Thank you Larry. It seems to be what I need. I've seen some uses of $self which were not defined in that example. Shouldn't be __PACKAGE__ instead? Unfortunately I don't know how to make it work in some cases: 1. If I use the test Catalyst server the static URLS that begin with /static don't work because I can't configure that server to not handle /static URLS. (But this is not so important). 2. Most important, if I need to use [% c.uri_for('/static', 'css', 'layout.css') %] for making it work even if I need to change the base location the app handles, then the static files are not served by Apache directly but by the app. If the app listens to the / location, the request is in this case: GET /en/static/css/layout.css HTTP/1.1 I think I could make a hack somehow and configure Apache to do a request to /static whenever the user tries to access /en/static or /fr/static... but I guess this could be done with mod_rewrite which I don't know how to use yet. Is there a more simple method to make the web server serve the static files directly? Thank you. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Deployment in practice
From: dab d...@catapulse.org Thank you all for your answers. It was very helpful. What about the database? If starting from a certain revision you need to make some database changes (adding tables, adding/deleting some table fields) how can we automate this? I mean, I think that we could run a script that add some tables and remove the unneeded fields from other tables, but if something goes wrong and we need to go back to the previous version, we would need the records from those fields. What can we do in these situations? Do the database update and the tests manually? Or back-up the entire database and then test the latest version of the app? Thanks. Octavian DBIx::Class::Schema::Versioned perhaps ? Dab I don't know... Does anyone use it? I read in its POD docs that At the moment, only SQLite and MySQL are supported., however in the past I've seen that when creating MySQL queries from a DBIC schema, some fields were wrongly created, including the size when not needed, like date date(10), so they should be corrected manually. Because of this, I don't know if this tool can be used for do the change automaticly... (Or was this issue solved since then?) Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] 10 Catalyst Models in 10 Days wrapping up-ish
From: Ashley a...@sedition.com Since we're on the subject, #9 TheSchwartz, is pretty clean now, in part thanks to Oleg Kostyuk who just alerted me to a problem. And the git depot has downloads with all the stuff working (once you do the dependencies): http://github.com/pangyre/p5-myapp-10in10/tree/master TheSchwartz model was the only one I needed to delete in order to be able to test the app, because I couldn't install TheSchwartz module under Windows. I have tried to just replace TheSchwartz with MooseX::TheSchwartz with no other changes, but this way I couldn't make the reminder work. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] 10 Catalyst Models in 10 Days wrapping up-ish
From: Ashley a...@sedition.com Hey, all. http://sedition.com/a/2733 is mostly done (I have serious repairs to do to make #9 work and might drop it entirely for a second stringer) Hi, Thank you for it. In the first model (Random quotes), I've seen the following line: sub get_one : method { Can you tell what does : method is used for and what happends if we don't use it? Is it ok if I will have more questions like this about the next models? Thank you. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] offset the URI of an existing Cat App
From: Ian Docherty catal...@iandocherty.com Hi I have always written Cat Apps so they start at the '/' URI but now I have been asked to 'offset' one so that:- /becomes /foo /userbecomes /foo/user /admin/1 becames /foo/admin/1 Hi, If using mod_perl, instead of: Location / SetHandler perl-script PerlResponseHandler MyApp /Location use: Location /foo SetHandler perl-script PerlResponseHandler MyApp /Location And the application should work at the new location. But if in the templates you use urls like: a href=/user.../a you need to change them to urls like: a href=[% c.uri_for('/user') %].../a If you use fastcgi, instead of: FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket Alias / /tmp/myapp.fcgi/ you could use: FastCgiExternalServer /tmp/myapp.fcgi -socket /tmp/myapp.socket Alias /foo /tmp/myapp.fcgi/ Note! I know these only from theory, because I always needed to use apps only at /. HTH. Octavian etc. I saw the __PACKAGE__-config-{namespace} that could be used but this would still require an entry in each of my controllers. e.g. package MyApp::Controller::Root; ... __PACKAGE__-config-{namespace} = 'foo'; ... package MyApp::Controller::Admin; ... __PACKAGE__-config-{namespace} = 'foo/admin'; ... etc. which strikes me as very unsatisfactory. I think I must have missed something. Is there a single point where I can make a change that will replicate through all my controllers? Can anyone put me right? Regards Ian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] offset the URI of an existing Cat App
From: Jim Spath jsp...@pangeamedia.com Octavian Râsnita wrote: But if in the templates you use urls like: a href=/user.../a you need to change them to urls like: a href=[% c.uri_for('/user') %].../a There is an alternative to using uri_for in every link: base href=[% c.request.base %] ... a href=user/a This method will work whether your deployment is at the base of the domain, or a subdirectory. Thanks for remembering about base. I think that this technique won't work if the links start with / though, like: a href=/user/a So, it is better to create the links using uri_for() from the beginning or use only relative links... Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Configuration process
From: Alejandro Imass alejandro.im...@gmail.com Why don't you just use the standard yml config file? If I remember well, the recommended configuration file type is .conf (Config::General) and not .yaml. Isn't it true? Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Mason + DBI + Catalyst?
On Tue, May 26, 2009 at 01:37:40AM +0200, Daniel Carrera wrote: Being able to chain resultsets makes it much much easier than using straight SQL, and you write less code. If you have a query you've constructed called $query, and lets say you now only want active records you can do $query = $query-search({ active = 1 }); In this way you can filter many things incrementally. But is that efficient? It looks like you are getting MySQL to return the entire data set and then making Perl filter it. That can't be efficient. Here it is a short code example that might appear in a controller: sub author : Local { my ($self, $c) = @_; #Variables you might get after the user submits a form: my $name = $c-req-params-{name}; my $country = $c-req-params-{country}; #Search the database for all fiction authors: my $authors = $c-model(DB::Authors)-search({ style = 'fiction', }); #Until this point DBIC doesn't touch the database. #Add filters based on what the user searched using the form: $authors = $authors-search({name = {-like = %$name%}) if $name; $authors = $authors-search({country = $country}) if $country; #Until this point, DBIC also didn't touch the database. #Add the $authors object to the stash, to be able to print it in a template: $c-stash-{authors} = $authors; #Until here, DBIC didn't touch the database } #And the subroutine ended. And then you can print some things using a Template-Toolkit template (authors.tt): [% IF some_variable = 1 %] [% FOREACH author = authors.next %] Name: [% author.name %] Country: [% author.country %] Localized birthday month: [% author.birthday.set_locale('fr').month_name %] The books of this author: [% FOREACH book = author.books %] [% book.title %] - [% book.editor %] [% END %] [% END %] [% END %] And at this point, DBIC still doesn't touch the database if the variable some_variable is not equal to 1 so the code below the IF line shouldn't be executed. But if the variable is 1, only at this point DBIC executes the necessary queries and get the data. And you have seen that due to the relations that were created in the DBIC result classes, it would be very simple to access not only data about the authors, but about his books or data that can be found in other related tables, without needing to define a new query. I wrote this code in Outlook Express and it might have bugs because I didn't test it, but I hope it helps to make an idea about what DBIC can do. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Slow fastcgi: A debugging aid
From: Ian Wells i...@cack.org.uk On 4 May 2009, at 09:19, Octavian Rasnita wrote: I have started using fastcgi with a Catalyst app, using it as an external server, but I've seen that it works very slow and many requests give a timeout error and display a 500 error because of this. This is a fairly standard sort of problem, so have a debugging aid: http://dev.catalystframework.org/wiki/gettingstarted/howtos/quick_and_dirty_FastCGI The idea here is that this produces a 'known good' minimal FastCGI implementation. Unfortunately, I can't test this properly at the moment due to issues with my development server, but please: - try it - ask me if you have problems, but if you have fixes, change the page! Hi, I tried it, but it gave the following error which I don't understand: 2009-05-04 20:04:04: (plugin.c.165) dlopen() failed for: /usr/lib64/lighttpd/mod_fastcgi.so /usr/lib64/lighttpd/mod_fastcgi.so: cannot open shared object file: No such file or directory 2009-05-04 20:04:04: (server.c.621) loading plugins finally failed Thanks. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Slow fastcgi: A debugging aid
From: Ian Wells i...@cack.org.uk I tried it, but it gave the following error which I don't understand: 2009-05-04 20:04:04: (plugin.c.165) dlopen() failed for: /usr/lib64/lighttpd/mod_fastcgi.so /usr/lib64/lighttpd/mod_fastcgi.so: cannot open shared object file: No such file or directory 2009-05-04 20:04:04: (server.c.621) loading plugins finally failed You're missing the fastcgi plugin for lighttpd. How did you install lighttpd and what OS are you using? I use Fedora and I installed lighttpd with yum install ... Anyway, there are many things to say, but the result is that I went back to perl 5.8.8 and mod_perl. My development and test server is under Windows and the production server under Linux, so because perl is not a really fully portable language, I also need to do tests under the production server, which is not very nice. So going back to mod_perl was the easiest solution. When I used fastcgi, I've seen that the system started to swap, to fill almost the entire swap, and this is a sign that it might have big memory leaks. This is not a big issue with mod_perl but it is with fastcgi, and using other servers don't help very much. It would be nice to be able to limit the number of requests per fastcgi child process... Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Jason Kohles' tutorial on ExtJs editable data gridsandCatalyst
From: jagdish eashwar the model. Disregarding the instruction not to modify anything above the md5sum line, I changed the relationship name in People.pm from 'affiliation_id' to 'affiliation'. I could then access the affiliation_id column in the People table without having to mention the relationship name. Nice. But what is the recommended way for getting around the problem of the catalyst helper using the column name for the relationship name ? To what extent can one safely disregard the 'don't modify' instruction? You can disregard it entirely and make any change above that line, but you won't be able to re-create the class files using the helper anymore, because if the helper would re-create the modified (above that line) classes, it would delete all the changes that you made above that line, and your app might not work well because of this. It could be helpful though if the helper would accept a parameter that tell it to change all the classes that were not modified above that line, and create separate classes with a .new extension for those classes that were changed. It would be more flexible then, because we can still use it after we change some classes above the checksum. Until then... I've seen that the recommendation was to use the helper only until you need to make changes above that line, and after that point, use the classes as a base, and deploy them for changing the database. (I don't know if this solution would work with any database type though...) Anyway, does anyone have an example about how to do that deployment as easy as possible? Octavian___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Using mysql_enable_utf8
From: J. Shirley I don't know why it didn't work for the first time... Because MySQL is evil. (I use MySQL. Grudgingly) Well, now that Oracle bought MySQL, maybe it is the time to have some more courage and start using PostgreSQL... :-) Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] RFC: Sample press release and announcement homepage
Hi, I think that these announcements about Catalyst 5.8 would have a bigger effect if those who aren't Moose users already would understand a little which are the advantages of this new version of this framework. These announcement is OK, but I think it would be very helpful to also put a link to another page with some simple examples about how to use Moose in Catalyst for doing things that were not possible until this version. Show how to use attributes that couldn't be used without Moose, tell about other benefits offered by Moose in a Catalyst app, tell about how the speed of a Catalyst app is affected... Octavian - Original Message - From: John Napiorkowski jjn1...@yahoo.com To: catalyst@lists.scsys.co.uk Sent: Thursday, April 23, 2009 6:46 PM Subject: [Catalyst] RFC: Sample press release and announcement homepage Hi, I'm seeking feedback on: http://dev.catalystframework.org/wiki/releaseannouncements And in particular my first swing at something we can use as a press release and send to all the usual suspect (Slashdot, Digg, etc): http://dev.catalystframework.org/wiki/releaseannouncements/58pressrelease I could really use your feedback. This version has some placeholders for data I am trying to get but the verbiage is a bit too long I think. Anyway, please take a look, keep in mind this is something aimed for general release. It's probably still too technical. Thoughts, suggestions, abuse welcome. When it's done, I am hope we can get lots of people linking to it as far and wide as possible. We put a lot of effort into this code and we deserve recognition. John ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Tutorial for cache?
From: Jonathan Rockway j...@jrock.us * On Thu, Apr 16 2009, Peter Karman wrote: I had the same experience and just switched to the File cache plugin instead. Are you storing big things, i.e. pieces of data bigger than the cache pages? If so, fastmmap will silently not store those pieces of data. In general, I find it very flaky, and would recommend something else. From the portability perspective, I think that Cache::FileCache should be always prefered in order to allow installing some apps or cpan modules under Windows also. If somebody installs a certain app or perl module under Unix and want a better cache, I think it would be very simple to change it with a better caching system so it won't be a big issue. I tried to install some cpan modules like MojoMojo and AngerWhale under Windows in order to test them, but with no success until now... Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Re: [ANNOUNCE] Re: Catalyst Runtime 5.80001 - MooseX::MethodAttributes::Inheritable 0.06
From: Tomas Doran bobtf...@bobtfish.net Octavian Râsnita wrote: I want to report something that might be a packaging bug, or maybe you can tell me what could be the problem... This version requires MooseX-MethodAttributes-0.05.tar.gz and I couldn't install this module under Windows using CPAN. snip Hmm. If I remember correctly, I built that distribution on my new mac mini, but I may not have done. Can I build a couple of demo dists on my machines and send them to you off list so we can work out what in my setup might be causing issues for you? Oh yes, please do it. I've downloaded MooseX-MethodAttributes-0.06.tar.gz and tried to unarchive it, but this package also tried to put all the files and directories in the same directory (and also tried to overwrite Inheritable.pm because there are 2 files with this name in the distribution). It is strange because it unarchives fine under Linux and also under Windows using 7zip, but the cpan command line can't install it well under Windows. I've just built an updated distribution of MX::MethodAttributes (0.06) on a different system and shipped it to CPAN. This release also contains a bug fix which could be relevant to some applications. With 0.05, the following code would fail to correctly register any actions in your package: package MyApp::Controller::Foo; use base qw/Catalyst::Controller/; use Moose; however the recommended: package MyApp::Controller::Foo; use Moose; BEGIN { extends 'Catalyst::Controller' } was unaffected, as were classes which did not use Moose. This issue has been corrected for any users with applications using Moose with the previous pattern. Cheers t0m I found a very strange thing that I can't understand... I made a new app using catalyst T5 In this app I added 2 controllers: package T5::Controller::BlaBla; use strict; use warnings; use base 'TranzactiiBursiere::Controller::Base'; 1; package T5::Controller::Base; use strict; use warnings; use base 'Catalyst::Controller'; 1; If I start the development server using perl script/t5_server.pl the server starts fine. But if I rename the BlaBla.pm controller to Ana.pm and also edit it to be package T5::Controller::Ana; the server doesn't start, but gives the error below. It is strange because it is a new app that doesn't have other dependencies and it shouldn't have any conflict just because I changed the controller name. I've tested with other names for that controller, and some of them work and some of them don't. Here is the error given when using perl script/t5_server.pl E:\web\T5perl script/t5_server.pl Metaclass for Class::MOP::Class for T5::Controller::Base cannot support register _actions. at E:/perl510/site/lib/Catalyst/Controller.pm line 180 Catalyst::Controller::get_action_methods('T5::Controller::Base=HASH(0x40 a97bc)') called at E:/perl510/site/lib/Catalyst/Controller.pm line 189 Catalyst::Controller::register_actions('T5::Controller::Base=HASH(0x40a9 7bc)', 'T5') called at E:/perl510/site/lib/Catalyst/Dispatcher.pm line 596 Catalyst::Dispatcher::setup_actions('Catalyst::Dispatcher=HASH(0x3836924 )', 'T5') called at E:/perl510/site/lib/Catalyst.pm line 2096 Catalyst::setup_actions('T5') called at E:/perl510/site/lib/Catalyst.pm line 1084 Catalyst::setup('T5') called at E:/web/T5/script/../lib/T5.pm line 34 require T5.pm called at script/t5_server.pl line 55 Compilation failed in require at script/t5_server.pl line 55. E:\web\T5 Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] [ANNOUNCE] Catalyst Runtime 5.80001
Congratulations to all for this much awaited version! I want to report something that might be a packaging bug, or maybe you can tell me what could be the problem... This version requires MooseX-MethodAttributes-0.05.tar.gz and I couldn't install this module under Windows using CPAN. The cpan command installed it fine, without any errors, but the directory MethodAttributes was not installed and neither the sub-directories and files under it. I've downloaded from cpan.org, unarchived it with WinRar but WinRar tried to unarchive all the files and directories from this package in the same directory, which doesn't happends with other CPAN modules. Finally I've unarchived it with 7zip, compiled and it installed fine. Catalyst-Runtime installed fine under Windows XP. Octavian - Original Message - From: Tomas Doran bobtf...@bobtfish.net To: The elegant MVC web framework catalyst@lists.scsys.co.uk Sent: Saturday, April 18, 2009 11:28 PM Subject: [Catalyst] [ANNOUNCE] Catalyst Runtime 5.80001 The Catalyst Core Team is proud to announce that we've just shipped the next major release of the Catalyst framework, version 5.8001. This release is the result of the helpful contributions of a large number of people, comprising documentation, new features, bug fixes and entire branches of refactoring, and has taken over twelve months work. Specifically this release would not have been possible without the hard work put in by Guillermo Roditi and Scott McWhirter for the initial port, and Florian Ragwitz on method attributes, as well as their CPAN modules to support this. Huge thanks to those guys, and also to everyone providing patches for documentation, bug fixes, and new features. The major focus of this release is refactoring, and porting to Moose, which enables a lot of additional features, and gives you, the user, a lot of additional power to use when building your applications, and gives the Catalyst team a lot of power for extending the framework. Current applications will still run unmodified, but new code and extensions can start to fully take advantage of Moose. A lot of (previously inadvisable) techniques have become officially deprecated, producing warnings, and full documentation is provided in the distribution to explain any changes which may affect your applications or components. Extensive smoke testing for backwards compatibility has taken place as part of the release process, and we're confident that we haven't broken anything which wasn't a very bad idea in the first place :) The Runtime distributions will be on a CPAN mirror near you before long, but until then you have the option of getting them here: http://files.perldition.org/Catalyst-Runtime-5.80001.tar.gz A further explanation of all the changes can be found in Catalyst::Delta (included below). Thank you for your attention, and for using our software. t0m Full delta from 5.71: Deprecations: Please see Catalyst::Upgrading for a full description of how changes in the framework may affect your application. Below is a brief list of features which have been deprecated in this release: * ::[MVC]:: style naming scheme has been deprecated and will warn NEXT is deprecated for all applications and components, use MRO::Compat Dispatcher methods which are an implementation detail made private, public versions now warn. * MyApp-plugin method is deprecated, use Catalyst::Model::Adaptor instead. * __PACKAGE__-mk_accessors() is supported for backward compatibility only, use Moose attributes instead in new code. * Use of Catalyst::Base now warns New features: Dispatcher - * Fix forwarding to Catalyst::Action objects. * Add the dispatch_type method Restarter - * The development server restarter has been improved to be compatible with immutable Moose classes, and also to optionally use B::Hooks::OP::Check::StashChange to handle more complex application layouts correctly. $c-uri_for_action - Give a private path to the Catalyst action you want to create a URI for. Logging - Log levels have been made additive. Catalyst::Test - * Change to use Sub::Exporter. * Support mocking multiple virtual hosts * New methods like action_ok and action_redirect to write more compact tests Catalyst::Response - * New print method which prints @data to the output stream, separated by $,. This lets you pass the response object to functions that want to write to an IO::Handle. * Added code method as an alias for $res-status Consequences of the Moose back end: * Components are fully compatible with Moose, and all Moose features, such as method modifiers, attributes, roles, BUILD and BUILDARGS methods are fully supported and may be used in components and applications.
Re: [Catalyst] HTTP Response body doesn't get sent
From: Terence Monteiro tere...@deeproot.co.in Thanks a ton! It is indeed a reference to a Mail::Message::Body::Lines object. On stringification, the code works! Then try to stringify it: $c-res-body($content); Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] command in Catalyst tute part 4 for generating schema files (static creation) using DBIx::Class::TimeStamp needs tobeupdated
From: hkcl...@gmail.com On Sun, Mar 15, 2009 at 1:06 PM, Octavian Râsnita orasn...@gmail.com wrote: From: hkcl...@gmail.com Please let me know if anyone has problems with this in the current version of the tutorial (v5.7020): http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial The default behavior of Catalyst::Model::DBIC::Schema changed recently. To avoid incompatibilities, the tutorial now has you manually upgrade to at least v0.23 in A Static Database Model With DBIx::Class of MoreCatalystBasics.pod and go straight to load_namespaces (vs. first doing load_classes and migrating over). I believe everything should be working as long as people make sure they have the right version of Catalyst::Model::DBIC::Schema, but let me know if people run into issues. Thanks! Kennedy I've seen that if I remove the old Schema.pm and Schema directory and I use the helper to re-create them, it works fine, or at least it creates the files, because I haven't tested them yet. But if I let them in their place and I use the helper to re-generate them, no new file is created. Is this the way it should be? Octavian Hi Octavian, Thanks for your note. When you say no new file is created if you don't delete them, what if you make a change to the database (as is done in EXPLORING THE POWER OF DBIC of BasicCRUD.pod) and rerun it? It should then reflect the DB changes to the stuff above the DO NOT MODIFY line, but preserve everything below that line. Let me know if you are seeing a different behavior. Thanks! Kennedy Yes it works that way, but it doesn't create the Result directory and it doesn't store the result classes in it. It just updates the old classes. But if I delete the old classes, or at least the old schema class, it creates the Result directory and put them in it, and it also creates the new schema class which uses load_namespaces(). But in this second case, it doesn't remember what was after do not modify this or anything above in the result classes, and the update should be done manually. And I don't know if this is the expected behaviour or there is a bug or I am doing something wrong. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] command in Catalyst tute part 4 for generating schema files (static creation) using DBIx::Class::TimeStamp needs tobeupdated
From: hkcl...@gmail.com On Sat, Mar 21, 2009 at 11:08 AM, Octavian Râsnita orasn...@gmail.com wrote: Kennedy Yes it works that way, but it doesn't create the Result directory and it doesn't store the result classes in it. It just updates the old classes. But if I delete the old classes, or at least the old schema class, it creates the Result directory and put them in it, and it also creates the new schema class which uses load_namespaces(). But in this second case, it doesn't remember what was after do not modify this or anything above in the result classes, and the update should be done manually. And I don't know if this is the expected behaviour or there is a bug or I am doing something wrong. Octavian Are you using v0.23 of Catalyst::Model::DBIC::Schema: perl -MCatalyst::Model::DBIC::Schema -e \ 'print $Catalyst::Model::DBIC::Schema::VERSION\n' If so, it should create the Result directory and use load_namespaces instead of load_classes. If you are seeing something different, please let us know, but my understanding is that v0.23 should do load_namespaces by default. Thanks, Kennedy Yes, I use that version: C:\Documents and Settings\Octavianperl -MCatalyst::Model::DBIC::Schema -e print $Catalyst::Model::DBIC::Schema::VERSION Subroutine initialize redefined at E:/perl510/site/lib/Class/C3.pm line 70. Subroutine uninitialize redefined at E:/perl510/site/lib/Class/C3.pm line 88. Subroutine reinitialize redefined at E:/perl510/site/lib/Class/C3.pm line 101. 0.23 (With this occasion I've installed the latest version of Class::C3 and now those warnings don't appear anymore.) But I've tried again to re-create the result classes, however the schema class still uses load_classes() and the Result directory is not created. I've created another table in the database and I ran again the Catalyst helper, but the class for the new table is created in the same directory with the other classes, and still there is no Result directory created and the schema class still uses load_classes(). If I delete at least the schema class file, the helper works fine and the new schema file uses load_namespaces() and the result classes are stored in the Result directory, but in that case what's after do not modify this or anything above is not remembered. I use: Windows XP Pro perl, v5.10.0 built for MSWin32-x86-multi-thread Catalyst::Helper::Model::DBIC::Schema version 0.23. DBIx::Class version 0.08008. (I've upgraded to DBIx::Class 0.08010 and tried again to create the class files, but with the same results.) I can't upgrade to the version 0.08012 because when I try to install DBIx::Class, it crashes the perl interpreter, and there is no ppm package for this version yet, but... is it important this upgrade? Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] command in Catalyst tute part 4 for generating schema files (static creation) using DBIx::Class::TimeStamp needs to beupdated
From: hkcl...@gmail.com Please let me know if anyone has problems with this in the current version of the tutorial (v5.7020): http://search.cpan.org/perldoc?Catalyst::Manual::Tutorial The default behavior of Catalyst::Model::DBIC::Schema changed recently. To avoid incompatibilities, the tutorial now has you manually upgrade to at least v0.23 in A Static Database Model With DBIx::Class of MoreCatalystBasics.pod and go straight to load_namespaces (vs. first doing load_classes and migrating over). I believe everything should be working as long as people make sure they have the right version of Catalyst::Model::DBIC::Schema, but let me know if people run into issues. Thanks! Kennedy I've seen that if I remove the old Schema.pm and Schema directory and I use the helper to re-create them, it works fine, or at least it creates the files, because I haven't tested them yet. But if I let them in their place and I use the helper to re-generate them, no new file is created. Is this the way it should be? Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst::Plugin::Captcha
From: Emmanuel Quevillon t...@pasteur.fr Hi list, I am trying to use C::P::Captcha. It woks like a charm generating the captcha. However, the text generated in the png/jpeg captcha image is so tiny that I can't even decode it as a human being. Better use Catalyst::Controller::HTML::FormFu. You can easy add reCAPTCHA with it. reCAPTCHA also creates an audio file so more human beeings would be able to pass it. Catalyst::Plugin::Captcha considers the blind users that use a screen reader as beeing non human. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Google Summer of Code: mentors, projects
From: Kieren Diment dim...@gmail.com I'm still keen on the idea of an easy Perl/Catalyst installer. Something that might encompass local::lib, PAR and deployable on the three or four main OSs windows (strawberry perl), OS X (10.4 and 10.5, using the system provided perl) and linux (maybe debian and red hat based distros - again using the system perl). Also needs to work in an environment with no root/Administrator access. And a nice double click installer at the end would be good. I've rigged up an appalling hack to do this in windows that needs finessed, but I haven't looked at the other OSs. Mentoring? Well, what I can offer is to point a student in the right direction of who to talk to, not much else. I'm also very tolerant of stupidity being a somewhat mentally challenged programmer myself. It is a great idea for promoting Catalyst! A smart installer won't be necessary. I think a simple .tar.gz (or .zip) archive that contains all the modules which are not a part of the Perl distribution would be enough. The user could unarchive the file in a certain location like /home/user/Catalyst or C:\Catalyst then he could create new apps using a command like /home/user/Catalyst/bin/catalyst.pl MyApp or c:\Catalyst\bin\catalyst MyApp This would create the app in the current directory and the app would need to also add /home/user/Catalyst/lib or c:\Catalyst/lib in @INC. The user would be also able to install Catalyst under a server running Linux, create the apps under Windows and then he could archive the apps under Windows, upload them to the Linux server, unarchive them and run them. Of course, the only out of the box solution for running the apps would be the CGI way, because for running the testing server or for configuring fastcgi or mod_perl would need root permissions, but I think this is the same in case of other frameworks. (I don't know if using mod_php or mod_python requires the same permissions though...) Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Requirements for Catalyst
From: Bill Moseley mose...@hank.org On Wed, Feb 25, 2009 at 05:47:15PM +, Joel Bernstein wrote: The large change in memory after first request seems inevitable. Please tell me how can I measure the memory used by a Catalyst app. Thanks. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] stripping path parts and then redispatch?
I think this solution should be put at least in a wiki if not in the POD manual. Octavian - Original Message - From: Larry Leszczynski lar...@emailplus.org To: Bill Moseley mose...@hank.org; Catalyst Framework catalyst@lists.scsys.co.uk Sent: Tuesday, February 24, 2009 3:44 AM Subject: Re: [Catalyst] stripping path parts and then redispatch? Just wanted to pass along some solutions... To recap briefly: URLs are prefixed with the page language, e.g /en/foo/bar. The language needs to be stripped off and stashed, and the remainder of the request processed as if the language part had not been there, e.g. /foo/bar. I was trying to use $c-go(/foo/bar), which works if there is a Foo::bar() action, but which breaks if the action is supposed to be Foo::default() with the argument bar (or Foo::Bar::default() with no arguments). 1) Bill Moseley suggested a different approach which is seeming to work pretty well so far (thanks Bill), it involves subclassing MyApp-prepare_path() to tweak the path at beginning of processing, something like this: sub prepare_path { my $c = shift; $c-SUPER::prepare_path(@_); my @path_chunks = split m[/], $c-request-path, -1; return unless ( @path_chunks $valid_languages{$path_chunks[0]}); # Pull off first path chunk: my $language = shift @path_chunks; $c-stash-{language} = $language; # Create a request path from the remaining chunks: my $path = join('/', @path_chunks) || '/'; # Stuff modified request path back into request: $c-request-path($path); # Update request base to include whatever # was stripped from the request path: my $base = $c-request-base; $base-path($base-path . $language . '/'); } A nice side effect is that tweaking $c-request-base to include the language means the language is automatically included when you call $c-uri_for(). 2) In the process of trying to get $c-go() to work for an arbitrary path, I found a way that seems to make it work consistently even if the path is supposed to hit a default action: # Create your request path to wherever: my $path = /foo/bar/baz; # Stuff modified request path back into request: $c-request-path($path); # Create a new $c-action using $c-request-path. # Updates $c-action and $c-request-args. $c-dispatcher-prepare_action($c); $c-go($c-action, $c-request-args); This should work for any of $c-forward(), $c-detach(), $c-visit(), $c-go(). Thanks for all the suggestions, Larry ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Requirements for Catalyst
From: Jonathan Rockway j...@jrock.us * On Sat, Feb 21 2009, Ashley wrote: On Feb 21, 2009, at 3:04 PM, Jonathan Rockway wrote: We run lots of Catalyst apps on the smallest Linode. I think they give us something like 340M of RAM. This is enough. I use a 512M Slicehost for jrock.us, which runs my mail server and a few Catalyst applications Thank you all for your answers. It is great if Cat can work even with 256 MB of RAM. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] windows install issues (Was: RFC: New to Catalystquestions)
From: Rodrigo Oops, ok, sorry, I thought you had Strawberry. Last year I swapped all things Active for Strawberry Perl. In any case, maybe you can tinker with the ActivePerl cpan Config.pm so that it uses the MinGW compiler and the Strawberry cpan settings. The idea would be to make ActivePerl compile its modules using the Strawberry config settings.Don't know if that would work. Another way (if don't want to switch to strawberry flavored perl) is to just install Strawberry, then edit your PATH and strip off all c:\strawberry\... directories so that it won't disturb your ActivePerl installation. Then create a little bat file that will give you a strawberry prompt. Install modules with strawberry cpan, then copy them from strawberry\perl\site (and auto) into ActivePerl's \site directories. I've tried to use Strawberry Perl, but I've seen that I can't install some modules on it. I needed to install MIME::Tools by downloading the package manually, and doing perl Makefile.PL, dmake, skip dmake test and do only dmake install, because I couldn't do it using cpan. On the dmake test, it freezes on a certain test. I also couldn't install DBD::mysql, even though I've also tried without cpan, because on dmake it gives some errors I don't understand, even though I've added all those directories which perl Makefile.PL needs. I have also tried to install WxPerl with it, but without success. I've seen that the ppm it uses seems to be either very old or a different kind than that used by Activeperl because it seems to have less features. From this point of view, Perl is not a very good language for Windows because it is hard to adapt the modules that work fine under other systems. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] RFC: New to Catalyst questions
From: Rodrigo I have also removed it, but I found that I can't install DBIx::Class::EncodedColumn with cpan, and there is no ppm distribution for it. Wow. I haven't had a problem with that either, in at least 5 different XP machines. Are you running Vista? What's the error? I run Win XP Pro SP3. The error is below. I think the relevant error is: t/02digest1/32 Can't call method keysize on an undefined value at E:/perl510/site/lib/Crypt/OpenPGP.pm line 525. I have tried a: cpan install Crypt::OpenPGP But I received the message that this module is up to date. I use ActivePerl 5.10.0 build 1004. The full output is: CPAN.pm: Going to build G/GR/GRODITI/DBIx-Class-EncodedColumn-0.2.tar.gz Cannot determine perl version info from lib/DBIx/Class/EncodedColumn.pm Checking if your kit is complete... Looks good Writing Makefile for DBIx::Class::EncodedColumn Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. cp lib/DBIx/Class/EncodedColumn/Crypt/Eksblowfish/Bcrypt.pm blib\lib\DBIx\Class\EncodedColumn\Crypt\Eksblowfish\Bcrypt.pm cp lib/DBIx/Class/EncodedColumn.pm blib\lib\DBIx\Class\EncodedColumn.pm cp lib/DBIx/Class/EncodedColumn/Digest.pm blib\lib\DBIx\Class\EncodedColumn\Digest.pm cp lib/DBIx/Class/EncodedColumn/Crypt/OpenPGP.pm blib\lib\DBIx\Class\EncodedColumn\Crypt\OpenPGP.pm GRODITI/DBIx-Class-EncodedColumn-0.2.tar.gz nmake -- OK Running make test Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. E:\perl510\bin\perl.exe -MExtUtils::Command::MM -e test_harness(0, 'inc', 'blib\lib', 'blib\arch') t/*.t t/01load..ok t/02digest1/32 Can't call method keysize on an undefined value at E:/perl510/site/lib/Crypt/OpenPGP.pm line 525. # Looks like you planned 32 tests but ran 26. # Looks like your test exited with 2 just after 26. t/02digest Dubious, test returned 2 (wstat 512, 0x200) Failed 6/32 subtests Test Summary Report --- t/02digest (Wstat: 512 Tests: 26 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 32 tests but ran 26. Files=2, Tests=27, 2 wallclock secs ( 0.03 usr + 0.00 sys = 0.03 CPU) Result: FAIL Failed 1/2 test programs. 0/27 subtests failed. NMAKE : fatal error U1077: 'E:\perl510\bin\perl.exe' : return code '0x2' Stop. GRODITI/DBIx-Class-EncodedColumn-0.2.tar.gz nmake test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports GRODITI/DBIx-Class-EncodedColumn-0.2.tar.gz Running make install make test had returned bad status, won't install without force Failed during this command: GRODITI/DBIx-Class-EncodedColumn-0.2.tar.gz: make_test NO cpan ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] RFC: The paradox of choice in web development
From: Matt Pitts mpi...@a3its.com -Original Message- From: Octavian Rasnita [mailto:orasn...@gmail.com] Sent: Tuesday, February 17, 2009 7:56 AM To: The elegant MVC web framework Subject: Re: [Catalyst] RFC: The paradox of choice in web development From: Ali M. tclwarr...@gmail.com When Catalyst is not chosen I personally believe it the combination of two things 1. Perl is no longer perceived as an easy language, or language that make development easier. More exactly,, Perl is considered a language hard to learn, that creates a code hard to maintain, a language that uses a strange OOP style (because I guess there are no books for Perl beginners that teach about Moose or Mouse), a language which is too flexible and because of this it is not prefered by the large teams of programmers because each of them could have a different style. 2. Catalyst perceivably doesn't offer enough added value for developers who are not that much into Perl to make the sacrifice and use Perl anyway. If the programmers are not that much into perl, this means that they don't know how to use DBIx::Class and Catalyst and possibly other few modules which are usually used by Catalyst developers, and in that case they can't understand the power of Catalyst. If Catalyst wants to compete with RoR or other frameworks, it should be as easy to install as those frameworks, and the simple apps should be also very easy to create. The comparisons between web frameworks are not based on the number of the requests they serve, or on the number of database tables they manage, or on the number of backend servers they are installed on, but on the number of web sites that use those frameworks, so those comparisons might show that there are 100 sites that use RoR and only 5 that use Catalyst, but don't tell that 3 from those 5 sites that use Catalyst have 3 times more visitors than all those 100 sites that use RoR. And of course, the conclusion is that RoR is much better. I think that the success of other languages, especially Python is also due to the fact that they support better Windows than Perl. WxPython is better developed than WxPerl, there are even screen readers that interact with the GUI of the OS in Windows and Linux, and finally... the number of programmers for Windows is bigger than the number of programmers for Linux. Most Perl programmers use to consider good to publicly despise Windows and those who use Windows, and also consider that Perl is a language for the web, while those who use Python or even Ruby consider them very good languages for creating programs with a desktop GUI. Sad to say, but I completely agree with this. It's quite ironic how the drive of open source has only furthered the need for OS agnostic software and platforms, which in turn, has actually made life harder for things like Perl that have strong origins in *nix OSes. Oh yeah, we love Linux as a platform for its [list of goodies], but we can't ask our day-to-day workforce to switch desktops, so we need OS agnostic platforms that we can build in Windows and deploy in Linux. Seems to be the credo echoing from the business world. I myself am currently trying to support multiple developers (content perl) working on a Catalyst app from Windows desktops and it's been a bit of a process. Cygwin seems to be providing the best solution right now, but Cgywin Perl fork()ing breaks frequently for me in Vista, so no HTTP::Prefork, which makes development much, much slower. I really, really want to be able to just run my Cat apps in Windows, and I probably could get it going under ActiveState or Strawberry if I stuck to it, but I _need_ it to not be that hard. I'm sure I'm not the only one. In today's world of software that is cross-platform and OS agnostic at its core, Perl 5 is showing its age. Still love it though. v/r -matt pitts As someone said it many years ago (but I don't remember who was), Perl is dead... or something like that was the idea. With that ocasion came the idea of creating Perl 6 that should be totally different, but who knows when it will be ready. A better native OOP support in Perl would be wonderful, but I think those other ideas about how Perl 6 should look like are more important, like to have a kind of virtual machine like in DotNet or Java, and to use bytecode precompiled binaries which are totally portable. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] RFC: The paradox of choice in web development
From: Stuart Watt On Windows, for the most part, Perl is the easy bit. Getting it to talk to some parts of Windows is a bit harder. Getting it to run to a production standard with Microsoft technology is almost unbelievably complex. It would probably be much easier with Cygwin, Apache, etc., but then, the whole point of them is to hide Windows, so that isn't really a help. Getting Perl to talk to some parts of Windows and get information from different parts of Windows is very hard and it requires knowing very well the low level details of Windows, which is a big disadvantage of Perl. Unfortunately I don't think that this situation will change. If we talk about Perl as that low level functional language that have more than 200 internal functions, and don't care about CPAN modules, we can't say that it can always create portable programs, because not all those functions work well under Windows. If we consider Perl with all the CPAN modules, then we also can't say that it is very portable, because there are very many CPAN modules that can't be installed at all under Windows, and some other CPAN modules could be installed but they are just not made very well so they can't be compiled very easy. Perl isn't good for Symbian either and it is not as good as Java for other devices, but I think that even the lack of portability is a very big issue, it is not the biggest. I think the biggest issue is the fact that Perl with its CPAN modules are very hard to install, because even if perl is installed, many CPAN modules can be installed only if the user has root access and shell access, which in 99% of the times, it is not the case. Somebody asked me yesterday if I can create a web site for his small company, a little web shop which for the beginning should be very simple, no credit card payments required, and now I think that the costs involved for creating that site would be much bigger if I would use Perl and Catalyst than if I would use PHP. There are very many sites that offer PHP and MySQL access for a few dollars per month, and for some more they can offer more other features, but for using a host that offer shell access, I would need to have at least a virtual server where I could have root permissions in order to be able to install everything I need, including Catalyst and all other Perl modules, but this would cost much more, so that guy might want to choose something cheaper for the beginning. Of course that if his business will succeed, he might want to add new features to his site, and he might need to have even a dedicated server, but in that moment I doubt that he will decide to go for a Perl solution and abandon PHP. If Perl would offer a solution of deploying the Catalyst apps without needing to install anything with a root or shell access, using PAR or something else, Perl would have a much bigger success. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] RFC: The paradox of choice in web development
From: Jay Kuri j...@ion0.com I've been watching this discussion and I have ranted my less than constructive ravings in #catalyst. My more constructive ravings are below... First: Perl jobs are not decreasing. While there is not a ton of 'Buzz' around perl anymore... If you look at actual jobs stats: http://tiny.cc/kkcCM (or http://www.indeed.com/jobtrends?q=+perl+engineer%2C+perl+developer%2C+php+engineer%2C+php+developer% 2C+ruby+developer%2C+python+developer%2C+l= ) Perl is above all the others by some margin. It's hard to see all these other languages getting the buzz, when the one we all love is practically ignored in the press... but that doesn't make it any less good and though it's hard to tell right now, buzz does not equal real world usage. In my country there are no jobs for perl developers. There are jobs for Java, C#, C++ and PHp developers. The knowledge of perl is considered as an advantage in very few job announcements, but it is wanted mostly for administrative tasks, not for web development, and there are very few programmers that even heard about Catalyst. Maybe that's why I wrongly thought that this is the same in other countries. Overall, though, I think that most of us who have used Catalyst for any period of time know that it is not a beginners platform. It is a powerful set of tools to solve difficult and complex problems. I think we need to take a page out of the old Unix'ers handbook.Stop looking to be as accessible to newbies as the other options, and embrace our true position... which is simply Catalyst is better. Not because it's easier to learn, and certainly not because it forces you into one (easy or not) way of doing things but because you can bend it to whatever form you need to solve whatever problem you have, even the ones that are less computer science-y and more computer-room- in-the-office-y. (though we can certainly do the former as well) In my opinion, we should embrace the fact that Catalyst is bigger, more complex, and more able. When someone says 'well, Why isn't catalyst as clear-cut and simple to use like Rails?' we should encourage them... tell them 'Go... Go play with rails... and when you grow out of it, we'll be waiting for you.' We should position Catalyst as the big-sister framework, the one whose there for you when you are ready to take on big problems that can't be solved by a bit of automatic CRUD, the ones that can't be stuffed into the channels that someone else has already dug. We should communicate an attitude of 'yes, we can solve easy problems too, but we are particularly good at solving the harder ones.' If we want to compete for the niche of big sites, we should see why Google, Yahoo, Amazon, Ebay and other big sites like these don't use Catalyst, what they are using and why. Maybe they also have some reasons, because I guess they have developers that know very well about all the possible options. Catalyst shouldn't compete for the low end sites not because it wouldn't be nice, or because Catalyst can't be used for simple web apps, but because it uses perl and it requires shell access to install it and third party modules, and this option is not available for most low end sites, so it is not an option for everyone. The fact is that Oracle does not try to compete for the low end of the market with MySQL. They don't want it. They never did. Why do we? The comparison is good, but not very exact. I know companies which don't use PostgreSQL but Oracle, because Oracle is better known (because it offers discounts to the software companies that distribute it, so they have the interest of promoting it), and because Oracle offers tech support. The big companies usually want to pass the responsability to others, even if they need to pay some more. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] RFC: The paradox of choice in web development
From: Jay Kuri j...@ion0.com I think it's a mistake to try to compete with Rails for the newbie. Some large percentage of newbies will never do anything more than occasional tinkering if they stick with web development at all. We have limited resources and we don't want to waste our time there. To make Catalyst accessible to the rails-like newbie, we have a TON of work to do and it's the wrong direction, in my opinion. I think most of Catalyst users agree with this. I think Catalyst shouldn't target the market of small personal web sites stored on free web servers, or on $5/month web servers. But I also think Catalyst shouldn't target only the very big sites like Amazon or Ebay, but all the software companies that create web applications for their clients, but of course, the serious software companies, not those that have 1 or 2 developers. We should find why those companies prefer using DotNet and Java even for web sites, and try to show them that Perl/Catalyst is better. Most of them prefer Java/DotNet because they can find more programmers that know those languages, and we can't do anything to show them that there are many Perl programmers also, because there aren't, but we can show them that the productivity of Perl/Catalyst is much bigger than of Java/DotNet, so they won't need to hire so many programmers and finally they will be more efficient. Most of the software companies, or simple programmers know very well that Perl is a language very hard to maintain, because it is not strict, and each programmer can have its own way of doing things, and this is true. But at least we can show that Catalyst is not Perl, like that kind of Perl used in CGI scripts, but it is a language object oriented, it can reuse the code very easily and it is very clear and because of this... easy to maintain. It wouldn't be bad if the next Catalyst book would have a section for Good practice and for Recommended modules, or even better, if these sections would be promoted on the Catalyst's web site. That section shouldn't list a single module for a single operation, but there could be 2, or 3 modules with clarifications for when it is helpful to use one of them and when to use the another, but not let the users to choose from tens of modules of the same kind on CPAN. Another advantage of using Java/DotNet is that now most of the existing software companies already have their own created libraries that can be used on all their projects, so the productivity would be bigger if they would continue to use those languages. But we can show that most of the modules they've made, probably higher level libraries that help them to connect to HTTP and FTP servers, send email, do authentication, and other things, already can be done with modules from CPAN. But if we just tell the world about how great CPAN is and nothing more, it would be a disadvantage, because they will really see how great CPAN is, and they won't know what's good for them in there, and if the combination of modules they found is a good one that really works without having problems in the future. I know a few people that started to learn perl very few years ago, but they've started to learn to create CGI scripts, of course, because almost all the Perl books teach that, at least as an example, and this is not ok, because if they'll pass to Ruby, they would start immediately to create Ruby on Rails apps, and if we compare Perl's CGI with Ruby on Rails... it is very clear who wins. Maybe what I think it would be a good idea might be too aggressive, but I think we should also tell the potential Perl/Catalyst programmers what to not do, something like: The list of books that you should not read, because they are outdated: and The list of CPAN modules you shouldn't use because they are not good: or Don't create CGI scripts, because they are slow, hard to maintain and require too much work and put a very short explanation about why it is not good for them to do those things (and others). And of course, we should also show what the users should preferably do. This way, there are bigger chances that there will appear if not just a single way, at least a limited numbers of ways to create programs with perl, and not an infinite number like now, and if someone will see that a certain site made with Perl is not working fine, he might also see that there was a warning for not making the site that way, because it is not recommended, and the site doesn't work fine not because it is made in Perl, but because it doesn't follow some recommendations. I think that this way of using negative and positive recommendations is the only good way, because otherwise, nobody will convince all the perl programmers not to create new CPAN modules, and reinvent the wheel. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo:
Re: [Catalyst] RFC: The paradox of choice in web development
From: Ashley a...@sedition.com And while others have made good points there were many that weren't so hot. Using a big company as an example of a place that picks the best is ridiculous; their size and bureaucracy often mean they can't. When I was at Amazon I watched them burn millions of dollars on dead end projects It might not be a good example for developers, but it surely is a good example for the managers. All the managers want to use the same tools used by the important companies, because they can trust the big companies much more than the smaller and unknown ones, and if they would hear that Google uses Catalyst, Ebay uses Catalyst, Amazon uses Catalyst, and successfully, they will trust Catalyst more. Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] RFC: The paradox of choice in web development
I also agree with Dan. Catalyst tries to solve that problem in the RoR way - it offers a default ORM, a default template in its manual, but there are much more other perl tools which are not defined as the recommended ones. For example, HTML::FormFu is a very good form manager, but it doesn't create (yet) the javascript code for client-side validation. Instead of improving this form manager only (if it is the considered the best) to also create the JS code, other similar modules are improved, so finally becomes harder and harder to choose which is the best one, but none of them would be perfect. So finally the programmers might prefer to move to RoR or Django or something else, because it is prefered to eat a medium-good apple, than to find a very good apple after trying tens of bad-taste apples. Unfortunately I don't know if there is a solution for this, but less perl sites means that the demand for perl programmers is lower and lower each year, and this is one more reason for programmers of not beeing interested in perl. Octavian - Original Message - From: David Steiner tw03d...@technikum-wien.at To: catalyst@lists.scsys.co.uk Sent: Saturday, February 14, 2009 12:01 AM Subject: [Catalyst] RFC: The paradox of choice in web development Hi there, here's an interesting article that dandv (from #catalyst) has posted on his wiki [1]. it explains how TMTOWTDI can be bad for people starting out in catalyst, and how compareable webframeworks (RoR/Django) deal with this. [1] http://wiki.dandascalescu.com/essays/paradox-of-choice-in-web-development i added my comments to the article, suggesting that we step up on the documentation and marketing! we need to give the layperson a easier ride in starting out with catalyst. and that requires more tutorials/screencasts, better official documentation, and more books being written. tell me what you people think of the article and how we can get catalyst more used and known. Greetings, David ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/