[Catalyst] Program the logic
Hello all, I'm planning to program the logic of the application (the Model in MVC) previously to start with web page and the presentation. What is the best way to do it? (some philosophical remarks :)) What I see is that what Catalyst calls Model is just the Objects that map with the tables in the DDBB. And the logic of the application are developed in the Actions (in fact linked to the web application). I know is difficult in practice to separate both worlds (logic from the presentation) but that is the false promise of the MVC pattern :). Anyway, the question is just what is the best practice to program the logic and test it before link the logic with the web application?. (using the classes generated by the Class::DBI or whatever plugin). Regards, Edu ___ 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] HTTP::Body(::MultiPart) RFC md5 digests for uploads
Hello , Having used Catalyst for the last few months I was presented with a challenge; make Catalyst generate an MD5 sum for each uploaded file in a request, for files of (almost) arbitary length. Since MD5 summing a 640mb .iso is rather time consuming, it makes sense to calculate the sum on the fly as the incoming request is being processed. It took me some time to track down the fact that HTTP::Body::MultiPart was responsible for the writing of request data chunks to temporary files. Attached is a first try at this which includes patch HTTP::Body::Multipart to create a Digest::MD5 object and -add chunks of incoming data to it. patch Catalyst::Request::Upload to add and accessor for 'md5' patch Catalyst::Engine::prepare_uploads to take the upload object(s) from request-{_body}-upload and create Catalyst::Request::Upload object including the 'md5' attribute. I welcome comments about the sense and usefullness of this :) AB --- /usr/lib/perl5/site_perl/5.8.6/HTTP/Body/MultiPart.pm 2005-11-17 23:59:02.0 +1100 +++ HTTP/Body/MultiPart.pm 2006-06-28 17:16:39.0 +1000 @@ -3,7 +3,7 @@ use strict; use base 'HTTP::Body'; use bytes; - +use Digest::MD5; use IO::File; use File::Temp 0.14; @@ -277,11 +277,14 @@ $part-{fh} = $fh; $part-{tempname} = $fh-filename; + $part-{md5} = Digest::MD5-new; } } if ( $part-{filename} ( my $length = length( $part-{data} ) ) ) { -$part-{fh}-write( substr( $part-{data}, 0, $length, '' ), $length ); + my $chunk = substr( $part-{data}, 0, $length, ''); +$part-{fh}-write( $chunk , $length ); + $part-{md5}-add( $chunk ); } if ( $part-{done} ) { @@ -291,7 +294,6 @@ $part-{fh}-close; delete @{$part}{qw[ data done fh ]}; - $self-upload( $part-{name}, $part ); } ___ 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] Program the logic
On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: I'm planning to program the logic of the application (the Model in MVC) previously to start with web page and the presentation. Actually, the Controller is what is supposed to drive the logic of the application. The model is really just that: the model. It's usually mapped to some kind of storage engine such as a RDBMS. Many strong advocates of MVC specifically try to leave business logic out of the database. What I see is that what Catalyst calls Model is just the Objects that map with the tables in the DDBB. And the logic of the application are developed in the Actions (in fact linked to the web application). You'll see that it's a little more than that (at least when you're using DBIx::Class - Class::DBI can't even be compared feature-wise nowadays). I know is difficult in practice to separate both worlds (logic from the presentation) but that is the false promise of the MVC pattern :). Not really. It's something somewhat straight-forward when using something like Catalyst. All you've got to do is resist the temptation of polluting your controllers with things that really should be in your views. But sometimes it's even worth it. -Nilson Santos F. Jr. ___ 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] Program the logic
That leads to a new question: Is possible to call actions in the Controller without using a web browser? Thanks, --edu PD: I'll use DBIx::Class, sounds promising. 2006/6/28, Nilson Santos Figueiredo Junior [EMAIL PROTECTED]: On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: I'm planning to program the logic of the application (the Model in MVC) previously to start with web page and the presentation. Actually, the Controller is what is supposed to drive the logic of the application. The model is really just that: the model. It's usually mapped to some kind of storage engine such as a RDBMS. Many strong advocates of MVC specifically try to leave business logic out of the database. What I see is that what Catalyst calls Model is just the Objects that map with the tables in the DDBB. And the logic of the application are developed in the Actions (in fact linked to the web application). You'll see that it's a little more than that (at least when you're using DBIx::Class - Class::DBI can't even be compared feature-wise nowadays). I know is difficult in practice to separate both worlds (logic from the presentation) but that is the false promise of the MVC pattern :). Not really. It's something somewhat straight-forward when using something like Catalyst. All you've got to do is resist the temptation of polluting your controllers with things that really should be in your views. But sometimes it's even worth it. -Nilson Santos F. Jr. ___ 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] Program the logic
I'm not 100% sure I understand your question, but there are a couple of ways to call actions or methods associated with a Controller. Here are the ways I've found to programmatically call a catalyst action from within my logic, but of course the whole things gets started off with a http request to something: First, you can use the $c-forward() method. Using this allows you to forward to an action is has the bonus of passing $c for you automatically. You can also use $c-controller('Foo')-do_stuff; method. I'm so so familar with this one as I usually don't need it. I'm sure one of the other experts can fill in why this is useful. Also you can just 'plain vanilla' methods in your controller class and reference them with $self-method(). This is good when you want to encapsulate functionality without creating an action and poluting the action list needlessly. You might have: sub some_form : Public { my ($self, $c) = @_; if( $self-validate_these($c-request-parameters()) { .} } sub validate_these { my $parameters = shift @_; #run some validation } This can be really useful if you are subclassing Controller to make your own and want to encapsulate functionality. Remember, you don't need to make every single method in your controller an action! There is a $c-detach method which is similar to forwarding but doesn't return to the caller. You can also use the subrequest plugin to call an action. That is a lot like forwarding but it creates a totally new catalyst request. I've used this when trying to mimic a portal where the main page calls a bunch of URIs to assemble itself. If you want to call a catalyst action from outside the catalyst framework, I've used LWP to call URIs from things like cron jobs, etc. I don't know if there is a way to access catalyst any other way. I think that covers the ways and whys I've found with controller actions. Good Luck! --john - Original Message From: Eduardo Oliveros [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Wednesday, June 28, 2006 5:11:27 PM Subject: Re: [Catalyst] Program the logic That leads to a new question: Is possible to call actions in the Controller without using a web browser? Thanks, --edu PD: I'll use DBIx::Class, sounds promising. 2006/6/28, Nilson Santos Figueiredo Junior [EMAIL PROTECTED]: On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: I'm planning to program the logic of the application (the Model in MVC) previously to start with web page and the presentation. Actually, the Controller is what is supposed to drive the logic of the application. The model is really just that: the model. It's usually mapped to some kind of storage engine such as a RDBMS. Many strong advocates of MVC specifically try to leave business logic out of the database. What I see is that what Catalyst calls Model is just the Objects that map with the tables in the DDBB. And the logic of the application are developed in the Actions (in fact linked to the web application). You'll see that it's a little more than that (at least when you're using DBIx::Class - Class::DBI can't even be compared feature-wise nowadays). I know is difficult in practice to separate both worlds (logic from the presentation) but that is the false promise of the MVC pattern :). Not really. It's something somewhat straight-forward when using something like Catalyst. All you've got to do is resist the temptation of polluting your controllers with things that really should be in your views. But sometimes it's even worth it. -Nilson Santos F. Jr. ___ 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/ ___ 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] Program the logic
Thanks for your long answer. When you create a Catalyst application some tests are created also. I thought calling the Controller actions could be performed by the testing framework... (without using a browser)... I guess I was wrong :) thanks, Edu 2006/6/28, John Napiorkowski [EMAIL PROTECTED]: I'm not 100% sure I understand your question, but there are a couple of ways to call actions or methods associated with a Controller. Here are the ways I've found to programmatically call a catalyst action from within my logic, but of course the whole things gets started off with a http request to something: First, you can use the $c-forward() method. Using this allows you to forward to an action is has the bonus of passing $c for you automatically. You can also use $c-controller('Foo')-do_stuff; method. I'm so so familar with this one as I usually don't need it. I'm sure one of the other experts can fill in why this is useful. Also you can just 'plain vanilla' methods in your controller class and reference them with $self-method(). This is good when you want to encapsulate functionality without creating an action and poluting the action list needlessly. You might have: sub some_form : Public { my ($self, $c) = @_; if( $self-validate_these($c-request-parameters()) { .} } sub validate_these { my $parameters = shift @_; #run some validation } This can be really useful if you are subclassing Controller to make your own and want to encapsulate functionality. Remember, you don't need to make every single method in your controller an action! There is a $c-detach method which is similar to forwarding but doesn't return to the caller. You can also use the subrequest plugin to call an action. That is a lot like forwarding but it creates a totally new catalyst request. I've used this when trying to mimic a portal where the main page calls a bunch of URIs to assemble itself. If you want to call a catalyst action from outside the catalyst framework, I've used LWP to call URIs from things like cron jobs, etc. I don't know if there is a way to access catalyst any other way. I think that covers the ways and whys I've found with controller actions. Good Luck! --john - Original Message From: Eduardo Oliveros [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Wednesday, June 28, 2006 5:11:27 PM Subject: Re: [Catalyst] Program the logic That leads to a new question: Is possible to call actions in the Controller without using a web browser? Thanks, --edu PD: I'll use DBIx::Class, sounds promising. 2006/6/28, Nilson Santos Figueiredo Junior [EMAIL PROTECTED]: On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: I'm planning to program the logic of the application (the Model in MVC) previously to start with web page and the presentation. Actually, the Controller is what is supposed to drive the logic of the application. The model is really just that: the model. It's usually mapped to some kind of storage engine such as a RDBMS. Many strong advocates of MVC specifically try to leave business logic out of the database. What I see is that what Catalyst calls Model is just the Objects that map with the tables in the DDBB. And the logic of the application are developed in the Actions (in fact linked to the web application). You'll see that it's a little more than that (at least when you're using DBIx::Class - Class::DBI can't even be compared feature-wise nowadays). I know is difficult in practice to separate both worlds (logic from the presentation) but that is the false promise of the MVC pattern :). Not really. It's something somewhat straight-forward when using something like Catalyst. All you've got to do is resist the temptation of polluting your controllers with things that really should be in your views. But sometimes it's even worth it. -Nilson Santos F. Jr. ___ 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/ ___ 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:
Re: [Catalyst] Program the logic
On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: When you create a Catalyst application some tests are created also. I thought calling the Controller actions could be performed by the testing framework... (without using a browser)... I guess I was wrong :) Yes, it can be performed without using a browser. If you've at least tried running those test you'd have seen it. Also, if you were really up to it, you could write something like a Catalyst::Engine::Tk and have and have a somewhat weird URI-based Tk handling (i.e. each of your widgets actions would be described by an URI). It just doesn't make much sense since Catalyst is geared towards web development, but perfectly possible. -Nilson Santos F. Jr. ___ 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] PPM vs CPAN
Nilson Santos Figueiredo Junior wrote: On 6/26/06, Hugh Lampert [EMAIL PROTECTED] wrote: Just to let you know something amusing - I tried the preconfigured CPAN.pm that comes with ActiveState Perl 5.8.8. First, it took about 10 minutes to figure out I needed to type Enter+Space instead of just Enter to get my commands accepted. Then, upon trying the i command, I was informed there was a newer CPAN bundle available and that it was suggested I upgrade in place. After typing install Bundle::CPAN the most amazing chain of downloads, dialogs, makes, compiles, test outputs, etc. was initiated I was truly in fear for my life that something was going to get severely screwed up when it started downloading and compiling Crypt and PGP modules. In the end, after the upgrade I was forced to go through the CPAN configuration dialog anyway. Everything seems to have been successfully installed however and nothing seems to be amiss. I DO think for my own sanity that I will stick with PPM's where available, as THAT process seems to be mostly just download and copy to the appropriate location. This is rather weird. You shouldn't need to type Enter+Space. In fact, I'm not even sure if I understood you correctly. The CPAN shell is a regular command shell. You type your commands and press Enter as in any other shell. It IS weird - but on my Windows XP workstation the CPAN shell command interpreter does not accept commands when I hit Enter unless the Enter key is followed by a space. I have no idea what kind of parser is involved. It's not really important though because it DOES work. It's kind of like the Perl debugger not being restartable in ActiveState Perl (it gives some kind of POSIX constant not defined error)... it's annoying to a minor extent but still workable. You didn't really need to upgrade the CPAN shell but when you do it when it asks you if you're ready for manual configuration all you need to do is type no and it will auto-configure itself. Now, I know *this* is rather counter-intuitive. But the rest seems pretty intuitive to me. Coming from the Windows world, I am severely suspicious of allowing ANYTHING to configure itself. I worked through the dialog, it really wasn't a problem, just not what I wanted to do with my boss breathing down my neck regarding my choice of Catalyst as an application platform. The thing about using the CPAN shell is that you're able to use more modules and you'll usually have newer versions of the modules. You'll be able to see that some modules have optional dependencies and choose wether to install them or not (PPM doesn't follow optional dependencies). Of course it takes a little bit longer when installing through the CPAN shell because it actually runs the test cases on your machines so you're even safer when using it (it's perfectly possible that a module worked alright at ActiveState's server but doesn't work correctly on your machine due to various circumstances). I think you were a little bit frightened probably because it installed *a lot* a modules. This probablu happened because, since you previously only used PPM, you had a lot of outdates modules and when installing Bundle::* from the CPAN it installs everything in that bundle unless you've got the newest version. When installing normal modules it will only install a newer version if it's a module requirement. After installing some heavy-weight modules such as Task::Catalyst, DBIx::Class, Bundle::CPAN, PAR and POE most of your installs will end up being single module installs since you'll already have most of the usual dependencies installed. BTW, Why is it Task::Catalyst and not Bundle::Catalyst? I want to install this but it does not run, getting an NMAKE fatal error U1077, errors looking for GPG, etc. This is why I like the PPM packages... I'm assuming that anything that fails to make does not get installed in the perl lib tree, correct? -Nilson Santos F. Jr. ___ 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] PPM vs CPAN
Hugh Lampert wrote: Nilson Santos Figueiredo Junior wrote: On 6/26/06, Hugh Lampert [EMAIL PROTECTED] wrote: Just to let you know something amusing - I tried the preconfigured CPAN.pm that comes with ActiveState Perl 5.8.8. First, it took about 10 minutes to figure out I needed to type Enter+Space instead of just Enter to get my commands accepted. Then, upon trying the i command, I was informed there was a newer CPAN bundle available and that it was suggested I upgrade in place. After typing install Bundle::CPAN the most amazing chain of downloads, dialogs, makes, compiles, test outputs, etc. was initiated I was truly in fear for my life that something was going to get severely screwed up when it started downloading and compiling Crypt and PGP modules. In the end, after the upgrade I was forced to go through the CPAN configuration dialog anyway. Everything seems to have been successfully installed however and nothing seems to be amiss. I DO think for my own sanity that I will stick with PPM's where available, as THAT process seems to be mostly just download and copy to the appropriate location. This is rather weird. You shouldn't need to type Enter+Space. In fact, I'm not even sure if I understood you correctly. The CPAN shell is a regular command shell. You type your commands and press Enter as in any other shell. It IS weird - but on my Windows XP workstation the CPAN shell command interpreter does not accept commands when I hit Enter unless the Enter key is followed by a space. I have no idea what kind of parser is involved. It's not really important though because it DOES work. It's kind of like the Perl debugger not being restartable in ActiveState Perl (it gives some kind of POSIX constant not defined error)... it's annoying to a minor extent but still workable. You didn't really need to upgrade the CPAN shell but when you do it when it asks you if you're ready for manual configuration all you need to do is type no and it will auto-configure itself. Now, I know *this* is rather counter-intuitive. But the rest seems pretty intuitive to me. Coming from the Windows world, I am severely suspicious of allowing ANYTHING to configure itself. I worked through the dialog, it really wasn't a problem, just not what I wanted to do with my boss breathing down my neck regarding my choice of Catalyst as an application platform. Once you've got CPAN configured and nmake and a gcc installed, http://shadowcatsystems.co.uk/static/cat-install will install Catalyst itself plus deps hands-off via CPAN (with a little help from ppm on windows) BTW, Why is it Task::Catalyst and not Bundle::Catalyst? I want to install this but it does not run, getting an NMAKE fatal error U1077, errors looking for GPG, etc. This is why I like the PPM packages... I'm assuming that anything that fails to make does not get installed in the perl lib tree, correct? See http://search.cpan.org/~adamk/Task-1.01/lib/Task.pm for an explanation. -- Matt S Trout Offering custom development, consultancy and support Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ + ___ 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] PPM vs CPAN
Matt S Trout wrote: Once you've got CPAN configured and nmake and a gcc installed, http://shadowcatsystems.co.uk/static/cat-install will install Catalyst itself plus deps hands-off via CPAN (with a little help from ppm on windows) Err, yes... gcc... seems to be a bit of a problem. Hate to impose on the members of the list, but can anyone point me in the direction of a good win32 binary GCC package that doesn't require Cygwin or other environments? the CPAN module was kind enough to download and install NMAKE from Microsoft itself (that was nice), when I upgraded it. BTW, Why is it Task::Catalyst and not Bundle::Catalyst? I want to install this but it does not run, getting an NMAKE fatal error U1077, errors looking for GPG, etc. This is why I like the PPM packages... I'm assuming that anything that fails to make does not get installed in the perl lib tree, correct? See http://search.cpan.org/~adamk/Task-1.01/lib/Task.pm for an explanation. Thanks, that was very informative! (well beyond my level, but still very informative). -- Hugh ___ 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] PPM vs CPAN
On Wed, Jun 28, 2006 at 01:09:13PM -0400, Hugh Lampert wrote: Err, yes... gcc... seems to be a bit of a problem. Hate to impose on the members of the list, but can anyone point me in the direction of a good win32 binary GCC package that doesn't require Cygwin or other environments? Depends how strictly we interpret your question. If you can handle having a runtime DLL, you should be able to install gcc and binutils without needing a full Cygwin/UWIN/MinGW32 environment. If you want something fully native, you'll still not have anything providing (most of) the POSIX function set just using MS' libraries, AFAIK. http://www.mingw.org/x86-win32-ports.shtml Your best bet will be to install something from that list, I guess. Perhaps somebody should write a gcc-compatible C compiler in Perl. /joel ___ 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] PPM vs CPAN
Hugh Lampert wrote: Matt S Trout wrote: Once you've got CPAN configured and nmake and a gcc installed, http://shadowcatsystems.co.uk/static/cat-install will install Catalyst itself plus deps hands-off via CPAN (with a little help from ppm on windows) Err, yes... gcc... seems to be a bit of a problem. Hate to impose on the members of the list, but can anyone point me in the direction of a good win32 binary GCC package that doesn't require Cygwin or other environments? the CPAN module was kind enough to download and install NMAKE from Microsoft itself (that was nice), when I upgraded it. From the top of that script - # This is the Shadowcat Catalyst installer. Its purpose is to make it easier # and quicker to get started with Catalyst development. In order to use it, # make sure you have perl 5.8.1+, a make and a compiler, (nmake and dev-c++ # are good on windows), a configured CPAN.pm and Module::Build installed. -- Matt S Trout Offering custom development, consultancy and support Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ + ___ 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] PPM vs CPAN
On 6/28/06, Hugh Lampert [EMAIL PROTECTED] wrote: Err, yes... gcc... seems to be a bit of a problem. Hate to impose on the members of the list, but can anyone point me in the direction of a good win32 binary GCC package that doesn't require Cygwin or other environments? the CPAN module was kind enough to download and install NMAKE from Microsoft itself (that was nice), when I upgraded it. Although it's somewhat like killing a mosquito using a shotgun, I usually install the Dev-Cpp open-source IDE for Windows. It already comes with everything you need to self-compile your modules (GCC/MinGW, etc) and works out-of-the-box. It's not a big download (8mb I think) so it's something pretty reasonable. The only manual configuration I remeber having to do is to add the GCC /bin dir to my system PATH variable. And then the CPAN shell from ActiveState will automatically configure itself and work using GCC. Since you've upgraded your CPAN shell using a version from the CPAN, I don't know if the magic still works and you might have to manually configure your compiler parameters (but that's a one time thing). -Nilson Santos F. Jr. ___ 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] pass array to template?
Hi Sarah How can I pass an array to Template Toolkit, then loop through it? You need to pass a pointer to array otherwise you get the scalar (length) of the array: $c-stash-{numarray} = [EMAIL PROTECTED]; Regards, Peter ___ 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] pass array to template?
Sarah Berry wrote: How can I pass an array to Template Toolkit, then loop through it? I'm trying to pass it through the stash just like anything else, as follows: in .pm file: my @numtextCaps = (Zero, One, Two, Three, Four, Five, Six, Seven, Eight); $c-stash-{numarray} = @numtextCaps; in .tt file: [% FOREACH word = numarray %] h3[% word %]/h3 [% END %] The loop only iterates once, and prints out: 9 at that one iteration. My code seems to match the way the foreach loop is done in the Template Toolkit documentation, so I must be missing something in the way TT interacts with Catalyst? $c-stash-{numarray} = [EMAIL PROTECTED]; As we said on the DBIC list, read perldoc perlreftut and perlref for full info about how all this works. -- Matt S Trout Offering custom development, consultancy and support Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ + ___ 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] pass array to template?
On 6/28/06, Matt S Trout [EMAIL PROTECTED] wrote: Sarah Berry wrote: How can I pass an array to Template Toolkit, then loop through it? I'm trying to pass it through the stash just like anything else, as follows: $c-stash-{numarray} = @numtextCaps; $c-stash-{numarray} = [EMAIL PROTECTED];As we said on the DBIC list, read perldoc perlreftut and perlref for full infoabout how all this works.Thanks, that was my problem. Guess I missed that part ... ___ 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] [announce] Catalyst 5.70 developer release.
Please be consistent with the number of digits in the versioning scheme. While it may be easy for humans to guess that 5.7001 comes before 5.80, packaging tools like RPM and APT could easily get confused. While such problems could be worked around by using tricks like epoch numbers, it would be best to avoid the headache altogether with a sane versioning scheme. Derek On 26 Jun 2006, at 05:25 , Matt S Trout wrote: Lars Balker Rasmussen wrote: On Mon, Jun 26, 2006 at 10:18:54AM +0200, Krzysztof Krzyzaniak wrote: Marcus Ramberg wrote: I've just pushed Catalyst 5.70_01 to CPAN. You can check it out here: Is final version will be numbered as 5.70? 5.7000 or 5.7 hopefully :-) Your friendly FreeBSD ports guy, Already born in mind. We figured it wouldn't make much difference leaving off the extra zeros for a dev release though. ___ 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] [announce] Catalyst 5.70 developer release.
Derek Poon [EMAIL PROTECTED] writes: Please be consistent with the number of digits in the versioning scheme. While it may be easy for humans to guess that 5.7001 comes before 5.80, packaging tools like RPM and APT could easily get confused. While such problems could be worked around by using tricks like epoch numbers, it would be best to avoid the headache altogether with a sane versioning scheme. Derek It's packagers problem, I know. I am changing in debian package to 'normal' version scheme. But then debian/watch doesn't work. But this is really minor problem. 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] [announce] Catalyst 5.70 developer release.
Derek Poon wrote: Please be consistent with the number of digits in the versioning scheme. While it may be easy for humans to guess that 5.7001 comes before 5.80, packaging tools like RPM and APT could easily get confused. While such problems could be worked around by using tricks like epoch numbers, it would be best to avoid the headache altogether with a sane versioning scheme. Already born in mind. We figured it wouldn't make much difference leaving off the extra zeros for a dev release though. -- Matt S Trout Offering custom development, consultancy and support Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ + ___ 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] [announce] Catalyst 5.70 developer release.
Krzysztof Krzyżaniak wrote: Derek Poon [EMAIL PROTECTED] writes: Please be consistent with the number of digits in the versioning scheme. While it may be easy for humans to guess that 5.7001 comes before 5.80, packaging tools like RPM and APT could easily get confused. While such problems could be worked around by using tricks like epoch numbers, it would be best to avoid the headache altogether with a sane versioning scheme. Derek It's packagers problem, I know. I am changing in debian package to 'normal' version scheme. But then debian/watch doesn't work. But this is really minor problem. Define normal ? The next production release will be 5.7000 - what's the problem with that? -- Matt S Trout Offering custom development, consultancy and support Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ + ___ 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] [announce] Catalyst 5.70 developer release.
On Wed, Jun 28, 2006 at 01:50:25PM -0700, Derek Poon wrote: Please be consistent with the number of digits in the versioning scheme. While it may be easy for humans to guess that 5.7001 comes before 5.80, packaging tools like RPM and APT could easily get confused. While such problems could be worked around by using tricks like epoch numbers, it would be best to avoid the headache altogether with a sane versioning scheme. This is indeed the point of the discourse below, although some of it may have been left out as I've previously convinced Matt on irc. (FreeBSD ports will indeed complain loudly about 5.6902 - 5.70, and I don't have the physique for jumping through hoops.) On 26 Jun 2006, at 05:25 , Matt S Trout wrote: Lars Balker Rasmussen wrote: 5.7000 or 5.7 hopefully :-) Your friendly FreeBSD ports guy, Already born in mind. -- Lars Balker RasmussenConsult::Perl ___ 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] [announce] Catalyst 5.70 developer release.
Matt S Trout [EMAIL PROTECTED] writes: Krzysztof Krzyżaniak wrote: Derek Poon [EMAIL PROTECTED] writes: Please be consistent with the number of digits in the versioning scheme. While it may be easy for humans to guess that 5.7001 comes before 5.80, packaging tools like RPM and APT could easily get confused. While such problems could be worked around by using tricks like epoch numbers, it would be best to avoid the headache altogether with a sane versioning scheme. Derek It's packagers problem, I know. I am changing in debian package to 'normal' version scheme. But then debian/watch doesn't work. But this is really minor problem. Define normal ? for example: first 5.6902, then 5.70_1 then 5.70. From debian point of view 5.70 is before 5.6902, 5.70_1 is invalid (so probably should be changed to 5.70.01 but then it's after 5.70 so probably should be changed into 5.69-5.70pre1 etc.). But this is minor problem, it's only make automatic tools blind but always can be changed manualy. The next production release will be 5.7000 - what's the problem with that? But will be tar.gz named Catalyst-Runtime-5.70.tar.gz or Catalyst-Runtime-5.7000.tar.gz? It makes difference with automatic upgradind tools. 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] development setup
Marcello Romani [EMAIL PROTECTED] wrote: because everyone is woking on the same project, so Yum! Stir fry! ___ 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/