Re: peer review for first CPAN module? (JavaScript minification)

2007-05-25 Thread Dr.Ruud
Joshua ben Jore schreef:
 Adriano Ferreira:
 Peter Michaux:

 I'm writing a new version of JavaScript::Minification on CPAN. This
 is my first CPAN module and first Perl project! If someone is
 willing to take a look to see if I've done something terribly wrong
 packaging the code I would greatly appreciate any feedback.

 Currently the new module is in a subversion repository. If you have
 subversion you should be able to check it out and test it with

 svn co http://dev.michaux.ca/svn/random/JavaScript-Minifier
 cd JavaScript-Minifier
 perl MakeFile.PL
 make test

 Some comments on packaging:
 * it may be a good idea to add a LICENSE parameter to Makefile.PL
 (supported by ExtUtils::MakeMaker = 6.31)
 * you might like to add POD and POD coverage tests (for CPANTS' sake)

 Some comments on code:
 * it does not look like Perl code, but C code translated literally
 to Perl.

 That's because this is a translation of the C program, jsmin.
 http://javascript.crockford.com/jsmin.html

The code contains the strange '\000'.

I see basically 3 steps:
1. respect strings
2. remove comments
3. compress everything else

See also Javascript::Squish.
http://search.cpan.org/perldoc?JavaScript::Squish

-- 
Affijn, Ruud

Gewoon is een tijger.



Re: peer review for first CPAN module? (JavaScript minification)

2007-05-25 Thread Joshua ben Jore

On 5/25/07, Dr.Ruud [EMAIL PROTECTED] wrote:

Joshua ben Jore schreef:
 Adriano Ferreira:
 Peter Michaux:

 I'm writing a new version of JavaScript::Minification on CPAN. This
 is my first CPAN module and first Perl project! If someone is
 willing to take a look to see if I've done something terribly wrong
 packaging the code I would greatly appreciate any feedback.

 Currently the new module is in a subversion repository. If you have
 subversion you should be able to check it out and test it with

 svn co http://dev.michaux.ca/svn/random/JavaScript-Minifier
 cd JavaScript-Minifier
 perl MakeFile.PL
 make test

 Some comments on packaging:
 * it may be a good idea to add a LICENSE parameter to Makefile.PL
 (supported by ExtUtils::MakeMaker = 6.31)
 * you might like to add POD and POD coverage tests (for CPANTS' sake)

 Some comments on code:
 * it does not look like Perl code, but C code translated literally
 to Perl.

 That's because this is a translation of the C program, jsmin.
 http://javascript.crockford.com/jsmin.html

The code contains the strange '\000'.

I see basically 3 steps:
1. respect strings
2. remove comments
3. compress everything else


You may want want to convert from UTF16 to perl native strings, then
convert back. JavaScript is defined as being stored in UTF16 but
that's kind of unusual elsewhere. Isn't it?

Josh


Re: peer review for first CPAN module? (JavaScript minification)

2007-05-25 Thread Dr.Ruud
Joshua ben Jore schreef:
 Dr.Ruud:

 I see basically 3 steps:
 1. respect strings
 2. remove comments
 3. compress everything else

 You may want want to convert from UTF16 to perl native strings, then
 convert back. JavaScript is defined as being stored in UTF16 but
 that's kind of unusual elsewhere. Isn't it?

AFAIK, the UTF-16 of JavaScript is internal. So you can just put abc
in your JavaScript code, there is no need to make that \0a\0b\0c.
:)

-- 
Affijn, Ruud

Gewoon is een tijger.



anybody feel like translating some PHP to Perl?

2007-05-25 Thread David Nicol

http://news.com.com/2100-1029-6186430.html
--
It is not possible to make a mistake. (customary greeting given by
Bokononists when meeting a shy person)


Re: anybody feel like translating some PHP to Perl?

2007-05-25 Thread Andy Lester


On May 25, 2007, at 12:04 PM, David Nicol wrote:


http://news.com.com/2100-1029-6186430.html


I don't understand the PHP-Perl angle.

--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






Re: anybody feel like translating some PHP to Perl?

2007-05-25 Thread Andy Armstrong

On 25 May 2007, at 18:09, Andy Armstrong wrote:

Have they released source? The site says it's a hosted web service.


Ah. This: http://recaptcha.net/plugins/php/ ?

--
Andy Armstrong, hexten.net



Re: anybody feel like translating some PHP to Perl?

2007-05-25 Thread Andy Armstrong

On 25 May 2007, at 18:04, David Nicol wrote:

http://news.com.com/2100-1029-6186430.html


Have they released source? The site says it's a hosted web service.

--
Andy Armstrong, hexten.net



Re: anybody feel like translating some PHP to Perl?

2007-05-25 Thread Andy Armstrong

On 25 May 2007, at 18:04, David Nicol wrote:

http://news.com.com/2100-1029-6186430.html


Captcha::reCAPTCHA coming up as soon as I write some docs.

Here it is in action:

http://hexten.net/cgi-bin/captch.pl

--
Andy Armstrong, hexten.net



Re: anybody feel like translating some PHP to Perl?

2007-05-25 Thread Andy Armstrong

On 25 May 2007, at 19:53, Andy Armstrong wrote:

Here it is in action:

http://hexten.net/cgi-bin/captch.pl


Now on CPAN:

http://search.cpan.org/dist/Captcha-reCAPTCHA/

--
Andy Armstrong, hexten.net



Re: peer review for first CPAN module? (JavaScript minification)

2007-05-25 Thread David Nicol

On 5/25/07, Joshua ben Jore [EMAIL PROTECTED] wrote:

You may want want to convert from UTF16 to perl native strings, then
convert back. JavaScript is defined as being stored in UTF16 but
that's kind of unusual elsewhere. Isn't it?


As Dr. Ruud said; also, ECMAscript engine authors (at least
David Leonard) seem to regard normalizing everything to UTF8
as equally bizarre. The Xerxes XML parser, for instance, uses 16
internally.