Re: [Catalyst] Re: Upload problem

2008-12-24 Thread Tomas Doran


On 23 Dec 2008, at 18:13, Florent Angly wrote:
 I'd be interested in knowing what browser you used, or if you did  
any client side chopping of the files to allow uploading of files  
larger than 2GB. If there's no easy way, I could always forget  
about a workaround and have users put/upload the files manually,  
it's not like it's going to happen everyday.


My clients are perl, php, ruby and the curl command line application,  
so whilst it was a good guess, I don't really know how to get round  
it for you..


I guess I'd investigate flash, or a java applet, or something?

Cheers
t0m


___
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: Upload problem

2008-12-24 Thread Rodrigo
Try Google Chrome. It doesn't seem to complain about 4Gb file uploads. Using
the Catalyst test server should be fine.

Maybe you're pushing the multipart/form-data envelope here. Have you looked
into a more specialized, gmail-upload style, browser solution, such as
javascript libraries (extjs, dojo, etc.) or flash?

I haven't tried it myself, but it looks darn good:
http://max-bazhenov.com/dev/upload-dialog-2.0/index.php

cheers,
  rodrigo

On Tue, Dec 23, 2008 at 9:04 PM, Bernhard Graf cataly...@augensalat.dewrote:

 On Tue 23 Dezember 2008, Florent Angly wrote:

  I have now tried several browsers (Firefox, Epiphany, Internet
  Explorer), but none of them worked. Firefox and Epiphany did not
  complain and just refreshed the page, whereas Internet Explorer
  complained that The page cannot be displayed.

 A very very vague remembrance comes to my mind: I had a similar problem
 once, and AFAIR this was related to a broken Content-Length header...

 --
 Bernhard Graf

 ___
 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] Re: System call problem

2008-12-24 Thread Tomas Doran


On 19 Dec 2008, at 16:21, Florent Angly wrote:

Well, after some more fiddling and researching, I figured this  
problem out.

Using the modified command:
system(@formatdb_cmd) == 0 or die(Could not run command:  
@formatdb_cmd\nReturn status: $?\nMessage: $!);

I found out that my error message is:

No child processes
It turns out that in Catalyst, $SIG{CHLD} = 'IGNORE'. Setting $SIG 
{CHLD} to 'DEFAULT' makes the system() calls return the proper status.


I assume that you do this like this:

{
local $SIG{CHLD} = 'DEFAULT';
system('my system command');
}

Does doing something similar around $class-handle_request; in  
Catalyst/Engine/HTTP.pm make it work in a generic way so that you  
don't have to do this hack locally?


And is there any chance you could write a simple test which shows the  
return values being lost, so that we can properly fix this in  
Catalyst, with appropriate regression testing?


Cheers
t0m


___
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] installing catalyst on mac os

2008-12-24 Thread Tomas Doran


On 24 Dec 2008, at 00:25, Ashley wrote:
I love OS X but the Perl it has historically shipped with is  
historically no so hot. I would strongly recommend you install the  
latest 5.8 (NOT over your system perl but beside it) or 5.10.


I don't consider this good advice, especially for a beginner.

Catalyst runs *just fine* against the 5.8.6 that Apple ship. And I  
wouldn't recommend running 5.10.0 as that has a bug which makes it  
very hard to debug applications.



You should probably avoid Task::Catalyst entirely.


This is more sage advice, the failures being seen weren't in the core  
Catalyst, but in addons, although the fact that  
Test::WWW::Mechanize::Catalyst is failing isn't good, as this is one  
of the things everyone should be encouraged to be using :(


Has anyone looked into this yet?

Cheers
t0m


___
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] installing catalyst on mac os

2008-12-24 Thread Filippo A. Salustri

Tomas, Ashley, et al,

I've been using the installed version since I got the Mac - about 3 yrs 
ago.  I've done alot in that time - /never/ had any trouble with perl 5.8.6.


Just FYI, I'm a catalyst beginner, but I wrote my first perl script in 
1986.  So you can use big words and I'll very likely get it.


I was trying to install Task::Catalyst cuz the online Catalyst manual 
says so.  ...maybe the manual should be updated?


I do recall trying just 'install Catalyst' some time ago, but that 
crapped out too.  I'll try that again and see if the error messages look 
any different.


Will post if there's anything new to report.

I do appreciate all the input.
Cheers.
Fil

Tomas Doran wrote:


On 24 Dec 2008, at 00:25, Ashley wrote:
I love OS X but the Perl it has historically shipped with is 
historically no so hot. I would strongly recommend you install the 
latest 5.8 (NOT over your system perl but beside it) or 5.10.


I don't consider this good advice, especially for a beginner.

Catalyst runs *just fine* against the 5.8.6 that Apple ship. And I 
wouldn't recommend running 5.10.0 as that has a bug which makes it very 
hard to debug applications.



You should probably avoid Task::Catalyst entirely.


This is more sage advice, the failures being seen weren't in the core 
Catalyst, but in addons, although the fact that 
Test::WWW::Mechanize::Catalyst is failing isn't good, as this is one of 
the things everyone should be encouraged to be using :(


Has anyone looked into this yet?

Cheers
t0m


___
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/


--
Filippo A. Salustri, Ph.D., P.Eng.
Department of Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON, M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/

___
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] installing catalyst on mac os

2008-12-24 Thread Devin Austin
Hi Fillipo,

Have you checked out cat-install? It's located here:
http://www.shadowcat.co.uk/static/cat-install

Just wget that, and run perl cat-install and things should go as planned.

HTH,

-Devin

On Wed, Dec 24, 2008 at 4:51 AM, Filippo A. Salustri salus...@ryerson.cawrote:

 Tomas, Ashley, et al,

 I've been using the installed version since I got the Mac - about 3 yrs
 ago.  I've done alot in that time - /never/ had any trouble with perl 5.8.6.

 Just FYI, I'm a catalyst beginner, but I wrote my first perl script in
 1986.  So you can use big words and I'll very likely get it.

 I was trying to install Task::Catalyst cuz the online Catalyst manual says
 so.  ...maybe the manual should be updated?

 I do recall trying just 'install Catalyst' some time ago, but that crapped
 out too.  I'll try that again and see if the error messages look any
 different.

 Will post if there's anything new to report.

 I do appreciate all the input.
 Cheers.
 Fil

 Tomas Doran wrote:


 On 24 Dec 2008, at 00:25, Ashley wrote:

 I love OS X but the Perl it has historically shipped with is historically
 no so hot. I would strongly recommend you install the latest 5.8 (NOT over
 your system perl but beside it) or 5.10.


 I don't consider this good advice, especially for a beginner.

 Catalyst runs *just fine* against the 5.8.6 that Apple ship. And I
 wouldn't recommend running 5.10.0 as that has a bug which makes it very hard
 to debug applications.

  You should probably avoid Task::Catalyst entirely.


 This is more sage advice, the failures being seen weren't in the core
 Catalyst, but in addons, although the fact that
 Test::WWW::Mechanize::Catalyst is failing isn't good, as this is one of the
 things everyone should be encouraged to be using :(

 Has anyone looked into this yet?

 Cheers
 t0m


 ___
 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/


 --
 Filippo A. Salustri, Ph.D., P.Eng.
 Department of Mechanical and Industrial Engineering
 Ryerson University
 350 Victoria St, Toronto, ON, M5B 2K3, Canada
 Tel: 416/979-5000 ext 7749
 Fax: 416/979-5265
 Email: salus...@ryerson.ca
 http://deseng.ryerson.ca/~fil/ http://deseng.ryerson.ca/%7Efil/

 ___
 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/




-- 
Devin Austin
http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!
___
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] installing catalyst on mac os

2008-12-24 Thread Kieren Diment
Yes, Task::Catalyst is no longer used.  The current tutorial says to  
use Task::Catalyst::Tutorial which is maintained.  cpan  
Catalyst::Devel  has been fine for me on Mac, Linux and even  
Strawberry perl on windows (with the exception of having to notest  
install HTTP::Server::Simple which is buried somewhere deep in the  
dependency chain) recently.



On 24/12/2008, at 10:51 PM, Filippo A. Salustri wrote:


Tomas, Ashley, et al,

I've been using the installed version since I got the Mac - about 3  
yrs ago.  I've done alot in that time - /never/ had any trouble with  
perl 5.8.6.


Just FYI, I'm a catalyst beginner, but I wrote my first perl script  
in 1986.  So you can use big words and I'll very likely get it.


I was trying to install Task::Catalyst cuz the online Catalyst  
manual says so.  ...maybe the manual should be updated?


I do recall trying just 'install Catalyst' some time ago, but that  
crapped out too.  I'll try that again and see if the error messages  
look any different.


Will post if there's anything new to report.

I do appreciate all the input.
Cheers.
Fil

Tomas Doran wrote:

On 24 Dec 2008, at 00:25, Ashley wrote:
I love OS X but the Perl it has historically shipped with is  
historically no so hot. I would strongly recommend you install the  
latest 5.8 (NOT over your system perl but beside it) or 5.10.

I don't consider this good advice, especially for a beginner.
Catalyst runs *just fine* against the 5.8.6 that Apple ship. And I  
wouldn't recommend running 5.10.0 as that has a bug which makes it  
very hard to debug applications.

You should probably avoid Task::Catalyst entirely.
This is more sage advice, the failures being seen weren't in the  
core Catalyst, but in addons, although the fact that  
Test::WWW::Mechanize::Catalyst is failing isn't good, as this is  
one of the things everyone should be encouraged to be using :(

Has anyone looked into this yet?
Cheers
t0m
___
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/


--
Filippo A. Salustri, Ph.D., P.Eng.
Department of Mechanical and Industrial Engineering
Ryerson University
350 Victoria St, Toronto, ON, M5B 2K3, Canada
Tel: 416/979-5000 ext 7749
Fax: 416/979-5265
Email: salus...@ryerson.ca
http://deseng.ryerson.ca/~fil/

___
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] Re: System call problem

2008-12-24 Thread Florent Angly

Hi t0m,

I wouldn't really call this a Catalyst bug. It's more some sort of Perl 
behavior that I did know of / expect. My Catalyst code is along these 
lines (and runs on a Linux 2.6 kernel):


sub catalyst_run_app {
 my $original_sig_chld = $SIG{CHLD}; # system calls always return 
-1 (No child processes), even when the call is sucessful
 $SIG{CHLD} = 'DEFAULT'; # system calls will return 0 for success 
(-1 is a failure)

 use 'App';
 eval {
App::main(); # This function contains a system() call
 };
 $SIG{CHLD} = $original_sig_chld; # restore original sig chld value
 if ($@) { # check for execution errors
   # warn that there was an execution error
 }
 # Display results
}

There's some more info about this at: 
http://www.schwer.us/journal/2008/02/06/perl-sigchld-ignore-system-and-you/
I must say that I don't fully appreciate the differences between the 
different child signal methods. I'm happy with using 'DEFAULT'.


The easiest way to reproduce this behavior is to run these commands:
 perl -e '$SIG{CHLD} = 'IGNORE'; print system('echo').\n;'
Returns:
 -1
Whereas:
 perl -e '$SIG{CHLD} = 'DEFAULT'; print system('echo').\n;'
Returns:
 0

I'm not sure what you mean with using $class-handle_request; in 
Catalyst/Engine/HTTP.pm. My Catayst app runs using the Catalyst test 
server at the moment. I haven't deployed it on a standalone webserver yet.


Cheers,

Florent



Tomas Doran wrote:


On 19 Dec 2008, at 16:21, Florent Angly wrote:

Well, after some more fiddling and researching, I figured this 
problem out.

Using the modified command:
system(@formatdb_cmd) == 0 or die(Could not run command: 
@formatdb_cmd\nReturn status: $?\nMessage: $!);

I found out that my error message is:

No child processes
It turns out that in Catalyst, $SIG{CHLD} = 'IGNORE'. Setting 
$SIG{CHLD} to 'DEFAULT' makes the system() calls return the proper 
status.


I assume that you do this like this:

{
local $SIG{CHLD} = 'DEFAULT';
system('my system command');
}

Does doing something similar around $class-handle_request; in 
Catalyst/Engine/HTTP.pm make it work in a generic way so that you 
don't have to do this hack locally?


And is there any chance you could write a simple test which shows the 
return values being lost, so that we can properly fix this in 
Catalyst, with appropriate regression testing?


Cheers
t0m


___
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] Re: Upload problem

2008-12-24 Thread J. Shirley
On Tue, Dec 23, 2008 at 11:02 AM, Tomas Doran bobtf...@bobtfish.net wrote:

 On 23 Dec 2008, at 18:13, Florent Angly wrote:

  I'd be interested in knowing what browser you used, or if you did any
 client side chopping of the files to allow uploading of files larger than
 2GB. If there's no easy way, I could always forget about a workaround and
 have users put/upload the files manually, it's not like it's going to happen
 everyday.

 My clients are perl, php, ruby and the curl command line application, so
 whilst it was a good guess, I don't really know how to get round it for
 you..

 I guess I'd investigate flash, or a java applet, or something?

 Cheers
 t0m


On the Flash note, I have used it to upload larger files (only on the
order of a few hundred megabytes, not into the GB)

SWFUpload works very well, and doesn't thrash about completely in
Linux -- I had problems with YUI Uploader under Linux, though.

I think the browser hard limit is ~2GB, and some (Microsoft) browsers
have content-length bugs for other large sizes.

-J

___
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] Tracking down memory leaks

2008-12-24 Thread Bill Moseley
What are some good methods for tracking down memory leaks?  I used
Devel::Cycle on $c in handle_request() to find one leak.  But, I
suspect I've got a circular reference elsewhere still by the size of
my processes after a while.  (Processes start out showing 70MB and end
up at 140MB rss -- which includes shared memory, of course).

I'm also curious about seeing an increase in rss memory in a
very simple Catalyst application.  Could be my testing, or 5.10.0 on
this machine.

$ perl rssmem.pl
Start Rss : 7444
After one request Rss : 9592
Request 1000:  Rss: 9636
Request 2000:  Rss: 9696
Request 3000:  Rss: 9756
Request 4000:  Rss: 9816
Request 5000:  Rss: 9880

It's not that significant, and I think I restart my processes after 1000
requests.

$ cat rssmem.pl
use strict;
use warnings;
use HTTP::Request::AsCGI;
use Catalyst::Utils;
use Linux::Smaps;
my $smap = Linux::Smaps-new( $$ );
App-setup;

print 'Start Rss : ', $smap-rss, \n;
my $r = make_request();

my $before = $smap-all;
$smap-update;
print 'After one request Rss : ', $smap-rss, \n;

for ( 1 .. 5000 ) {
make_request();
next if $_ % 1000;

$smap-update;
print Request $_:  Rss:  . $smap-rss,\n;
}


sub make_request {
my $request = Catalyst::Utils::request( '/ping' );
my $cgi = HTTP::Request::AsCGI-new( $request, %ENV )-setup;

# Uncomment and no gain in rss.
#return;

App-handle_request;

return $cgi-restore-response;
}


package App;
use strict;
use warnings;
use Catalyst;

sub ping : Local {
my ( $self, $c ) = @_;
$c-res-body( 'ping' );
}














-- 
Bill Moseley
mose...@hank.org
Sent from my iMutt


___
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] Tracking down memory leaks

2008-12-24 Thread Stuart Watt

Bill Moseley wrote:

What are some good methods for tracking down memory leaks?  I used
Devel::Cycle on $c in handle_request() to find one leak.  But, I
suspect I've got a circular reference elsewhere still by the size of
my processes after a while.  (Processes start out showing 70MB and end
up at 140MB rss -- which includes shared memory, of course).
  
Devel::Leak saved me several times over, but I did need to build a 
debugging Perl to see the contents. When I did that, most of the leaks I 
was responsible for were easy to find and fix. I just used 
NoteSV/CheckSV in the loop, to pick up anything left from a previous 
iteration. In the end I still found DBI and some DBDs were responsible 
for most of my missing memory, and upgrading them took away of lot of 
issues.


All the best
Stuart
--
Stuart Watt
ARM Product Developer
Information Balance

I'm also curious about seeing an increase in rss memory in a
very simple Catalyst application.  Could be my testing, or 5.10.0 on
this machine.

$ perl rssmem.pl
Start Rss : 7444
After one request Rss : 9592
Request 1000:  Rss: 9636
Request 2000:  Rss: 9696
Request 3000:  Rss: 9756
Request 4000:  Rss: 9816
Request 5000:  Rss: 9880

It's not that significant, and I think I restart my processes after 1000
requests.

$ cat rssmem.pl
use strict;
use warnings;
use HTTP::Request::AsCGI;
use Catalyst::Utils;
use Linux::Smaps;
my $smap = Linux::Smaps-new( $$ );
App-setup;

print 'Start Rss : ', $smap-rss, \n;
my $r = make_request();

my $before = $smap-all;
$smap-update;
print 'After one request Rss : ', $smap-rss, \n;

for ( 1 .. 5000 ) {
make_request();
next if $_ % 1000;

$smap-update;
print Request $_:  Rss:  . $smap-rss,\n;
}


sub make_request {
my $request = Catalyst::Utils::request( '/ping' );
my $cgi = HTTP::Request::AsCGI-new( $request, %ENV )-setup;

# Uncomment and no gain in rss.
#return;

App-handle_request;

return $cgi-restore-response;
}


package App;
use strict;
use warnings;
use Catalyst;

sub ping : Local {
my ( $self, $c ) = @_;
$c-res-body( 'ping' );
}














  





___
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] Tracking down memory leaks

2008-12-24 Thread Bill Moseley
On Wed, Dec 24, 2008 at 11:47:45AM -0500, Stuart Watt wrote:
   
 Devel::Leak saved me several times over, but I did need to build a  
 debugging Perl to see the contents. When I did that, most of the leaks I  
 was responsible for were easy to find and fix. I just used  
 NoteSV/CheckSV in the loop, to pick up anything left from a previous  
 iteration. In the end I still found DBI and some DBDs were responsible  
 for most of my missing memory, and upgrading them took away of lot of  
 issues.

Which loop are you referring to?

perl -V shows -DDEBUGGING=-g

I tried using Devel::Leak but it ended up not very useful.  Perhaps using
it incorrectly.  For example, if I wrap the eval block in
handle_request() like this:

use Devel::Leak;
my $handle;
Devel::Leak::NoteSV($handle);
eval {
if ($class-debug) {
my $secs = time - $START || 1;
my $av = sprintf '%.3f', $COUNT / $secs;
my $time = localtime time;
$class-log-info(*** Request $COUNT ($av/s) [$$] [$time] ***);
}

my $c = $class-prepare(@arguments);
$c-dispatch;
$status = $c-finalize;

use Devel::Cycle;
#find_cycle( $c );
};
Devel::Leak::CheckSV($handle);

Then I get a bunch of output like:

new 0xac62a60 : 
new 0xac62a70 : 
new 0xac62a80 : 
new 0xac62a90 : 

By a bunch I mean 16,979.  So, I don't quite think I'm doing it
correctly. ;)

-- 
Bill Moseley
mose...@hank.org
Sent from my iMutt


___
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] installing catalyst on mac os

2008-12-24 Thread Tomas Doran


On 24 Dec 2008, at 18:27, Ashley wrote:


On Dec 24, 2008, at 2:08 AM, Tomas Doran wrote:

On 24 Dec 2008, at 00:25, Ashley wrote:
I love OS X but the Perl it has historically shipped with is  
historically no so hot. I would strongly recommend you install  
the latest 5.8 (NOT over your system perl but beside it) or 5.10.


I don't consider this good advice, especially for a beginner.


He didn't say he was a Perl beginner. :)


Yeah, sorry - total misreading on my part there..

He said he was new to Catalyst. The perl + libs OS X ships with  
have caused me many problems (nothing with Cat springs to mind,  
more C-based things like Storable) in the past from the public beta  
to 10.4.


I've never had an issue with Apple's perl myself. I wouldn't use it  
for production (where I build my own from source), but I've always  
found it fine for development..


It's not bad advice, generally - but readers could have got the  
impression that Catalyst itself is unlikely to work on the perl which  
Apple ship, which isn't true..


This might be the problems with the temporarily out of sync content  
decoding layers in LWP v Mech. Which are all fixed in the newest  
versions. So installing LWP and WWW::Mechanize before Catalyst  
might be all that's needed.


I think that is just idle speculation...

I can confirm that right now for me, a freshly installed 5.8.8,  
pulling everything (including latest WWW::Mech, and latest LWP) from  
CPAN, WWW::Mech fails tests for me, as per:


http://www.nntp.perl.org/group/perl.cpan.testers/2008/12/msg2920088.html

https://rt.cpan.org/Ticket/Display.html?id=41834

Cheers
t0m


___
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] installing catalyst on mac os

2008-12-24 Thread Tomas Doran


On 24 Dec 2008, at 11:51, Filippo A. Salustri wrote:


I do recall trying just 'install Catalyst' some time ago, but that  
crapped out too.  I'll try that again and see if the error messages  
look any different.


How long ago is 'some time ago'?

I did this on a fresh perl 5.8.8 less than two weeks ago, and  
Catalyst-Runtime + Catalyst-Devel (and all dependencies) installed  
cleanly from CPAN.



Will post if there's anything new to report.


Please do :)

Cheers
t0m


___
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] installing catalyst on mac os

2008-12-24 Thread Ashley

On Dec 24, 2008, at 2:07 PM, Tomas Doran wrote:


On 24 Dec 2008, at 18:27, Ashley wrote:


On Dec 24, 2008, at 2:08 AM, Tomas Doran wrote:

On 24 Dec 2008, at 00:25, Ashley wrote:
I love OS X but the Perl it has historically shipped with is  
historically no so hot. I would strongly recommend you install  
the latest 5.8 (NOT over your system perl but beside it) or 5.10.


I don't consider this good advice, especially for a beginner.


He didn't say he was a Perl beginner. :)


Yeah, sorry - total misreading on my part there..

He said he was new to Catalyst. The perl + libs OS X ships with  
have caused me many problems (nothing with Cat springs to mind,  
more C-based things like Storable) in the past from the public  
beta to 10.4.


I've never had an issue with Apple's perl myself. I wouldn't use it  
for production (where I build my own from source), but I've always  
found it fine for development..


It's not bad advice, generally - but readers could have got the  
impression that Catalyst itself is unlikely to work on the perl  
which Apple ship, which isn't true..


I've used every single OS X from the PB and I've had problems with  
all of them except 10.5 but I didn't keep it long enough to know if  
it would cause problems, I upgraded Perl as soon as I got my new  
machine. Maybe I do more odd things than you, but many system  
installs are not particularly hot. The vendors make goofy, subjective  
choices and releases get frozen with bugs. Red Hat Perl has also had  
big problems, which clobbered DBIC among other libs, just as another  
example. You should cook your own if you know how.


This might be the problems with the temporarily out of sync  
content decoding layers in LWP v Mech. Which are all fixed in the  
newest versions. So installing LWP and WWW::Mechanize before  
Catalyst might be all that's needed.


I think that is just idle speculation...


I think that's just a cliche to fill space... There was an ongoing  
problem between Mech and LWP regarding decoding layers it was  
discussed on those lists, Perl Monks, and here too as it was messing  
with testing Cat apps. It was fixed. The last time I updated was  
about then and everything went fine. Without looking at test output  
it was a perfectly reasonable guess.


I can confirm that right now for me, a freshly installed 5.8.8,  
pulling everything (including latest WWW::Mech, and latest LWP)  
from CPAN, WWW::Mech fails tests for me, as per:



You're right. It's bad live tests. They're checking live sites which  
is prone to falling down, obviously, because sites change content.


All the unit tests pass so a force install in this case is completely  
reasonable.


j...@jasper[124]~/build/WWW-Mechanize-1.52prove -l lib t
t/00-load.1/2 # Testing WWW::Mechanize 1.52, with LWP  
5.822, Perl 5.01, /usr/bin/perl

t/00-load.ok
t/add_header..ok
t/aliases.ok
t/area_link...ok
t/autocheck...ok
t/clone...ok
t/cookies.ok
t/credentials-api.ok
t/credentials.ok
t/die.ok
t/field...ok
t/find_frame..ok
t/find_image..ok
t/find_inputs.ok
t/find_link-warnings..ok
t/find_link...ok
t/find_link_idok
t/form-parsingok
t/frames..ok
t/image-new...ok
t/image-parse.ok
t/link-base...ok
t/link-relative...ok
t/linkok
t/new.ok
t/pod-coverageok
t/pod.ok
t/regex-error.ok
t/save_contentok
t/select..ok
t/taint...ok
t/tickok
t/upload..ok
t/warnok
t/warningsok
All tests successful.
Files=35, Tests=339, 20 wallclock secs ( 0.45 usr  0.41 sys + 14.26  
cusr  2.88 csys = 18.00 CPU)

Result: PASS


___
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: OT: Better TT pager?

2008-12-24 Thread Aristotle Pagaltzis
* Jesse Sheidlower jes...@panix.com [2008-12-23 12:45]:
 Does someone have a model I can steal from?

I have something pretty close to that. Not entirely happy insofar
as that I want to add the ability show a few links to skip 10 and
20 pages as appropriate, and it’s not abstracted as it should be,
but as a starting point it should work.

USE decimal = format('%d') ;
BLOCK pagination ;
  IF NOT page ; page = 0 ; END ;
  last_page = decimal( ( num_trials - 1 ) / per_page );

  IF last_page ;
%]div class=pagination[%
%]a href=[% c.req.uri_with( page = [] ) %][% ' class=current' IF 
NOT page %]1/a[%

linked_page = page - 4 ;
IF linked_page  1 ; linked_page = 1 ; END ;

until_page = linked_page + 7 ;
IF last_page = until_page ;
  until_page = last_page - 1 ;
  linked_page = until_page - 7 ;
  IF linked_page  1 ; linked_page = 1 ; END ;
END ;

'i#x2026;/i' IF 1  linked_page ;

WHILE ( linked_page = until_page ) AND ( linked_page  last_page ) ;
  %]a href=[% c.req.uri_with( page = linked_page ) %][% ' 
class=current' IF page == linked_page %][% linked_page + 1 %]/a[%
  linked_page = linked_page + 1 ;
END ;

'i#x2026;/i' IF linked_page  last_page ;
%]a href=[% c.req.uri_with( page = last_page ) %][% ' 
class=current' IF page == last_page %][% last_page + 1 %]/a[%

%]/div[%
  END ;
END ;

This is also a perfect demonstration of why I say that TT sucks.
This should by all rights be handled in the template since it’s
display logic, but writing it in that TT mini-language rather
than Perl is fugly. And PERL and RAWPERL blocks have their own
problems. Anyway. Someday I’ll quit yapping and write some code.

The CSS for styling that looks like this:

div.pagination {
margin: 1.1em 0 0.5em;
text-align: right;
padding: 0.2em 0;
}

div.pagination i {
font-style: normal;
}

div.pagination a:link,
div.pagination a:visited {
border: 1px solid #359;
background-color: #f0f0e6;
padding: 0.1em 0.3em;
margin: 0 0.2em;
}

div.pagination a.current,
div.pagination a:focus,
div.pagination a:hover,
div.pagination a:active {
background-color: #47b;
color: #fff;
}

I’m not sure how selfcontained that is, but I can’t be bothered
to dig through the rest of my stylesheets right now.

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.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/