Re: New cross-language web development framework called Jasper
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Apr 2006 15:11:18 GMT
"biggus" <sourceforge@xxxxxxxxxxxxx> wrote in
news:1145542611.298497.290640@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
I've just finished a new cross-language web developement framework
called Jasper. It supports several (four, in fact) platforms and
languages, Perl amongst them.
I am posting this new thread since I want others to have a go with
Jasper, and hopefully provide some helpful comments.
package StringUtils;
sub chomp {
my $str = shift;
$str =~ s/[\n\r]+$//;
return ( $str );
}
Read perldoc -f chomp to see what chomp actually does.
sub toLower {
my $str = shift;
$str =~ tr /A-Z/a-z/;
return ( $str );
}
sub toUpper {
my $str = shift;
$str =~ tr /a-z/A-Z/;
return ( $str );
}
Perl builtins lc and uc should be used in preference.
sub equals {
my $first = shift;
my $second = shift;
return ( $first eq $second );
}
You should directly use the eq operator in your code as opposed to
relagating the comparison to a silly subroutine.
sub len {
my $str = shift;
return ( length( $str ) );
}
Again, directly call the Perl builtin.
sub split {
my $str = shift;
my $divider = shift;
return split( /$divider/, $str );
}
Ditto.
In summary, most of the code you have written is completely unnecessary.
Most of the code which is not necessary is either wrong, or bug-prone.
I use frameworks and modules written by others to make it easier to
solve *new* problems, not to experience the same problems over and over
again.
Sinan
--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
.
- Follow-Ups:
- References:
- Prev by Date: Re: newby question : parse xml file
- Next by Date: need help with text wrap problem...
- Previous by thread: Re: New cross-language web development framework called Jasper
- Next by thread: Re: New cross-language web development framework called Jasper
- Index(es):
Relevant Pages
|
Loading