Posted by Rick DeNatale
Thu, 05 Oct 2006 15:23:00 GMT
Ruby has a nifty method in kernel called open. It’s quite powerful in the way it interprets its first argument, a string telling it what to open. It can open a file, or it can open a pipe to a sub-process it creates to run a command in that string. It takes quite a bit of open function has a similar interpretation of it’s first argument. Again it takes quite a bit of documentation to describe.
Which is a cause for concern. Most things that powerful can be misused.
I use an application called Awstats to get statistics on my websites. Awstats is a very popular application which is written in perl.
But I long ago disallowed access to Awstats from the outsite world after I found that my system had been compromised by a bad guy exploiting perl’s open function.
Read more...
Posted in ruby | Tags bestpractice, perl, security | no comments | no trackbacks
Posted by Rick DeNatale
Wed, 16 Aug 2006 15:03:18 GMT
An old programming adage goes: “You can write Fortran in any language.”
Computer languages, like natural languages, tend to spawn their own cultures and religions. And it’s not unexpected that the groups associated with these have different slants on things.
One of Ruby’s strengths is that it stole from the best. When I look at the language, it feels like Matz took the best features from a variety of languages including Smalltalk, Lisp, and not the least, Perl.
Two great features which Ruby inherited from Perl are integral support for regular expressions, and Perl’s excellent statement modifiers which allow things like:
to be replaced with the more succinct and usually clearer:
However,
IMHO, overuse of the Perl features in Ruby can make code
too Perl-like.
I’ve seen my share of Ruby code which is hard-to read and understand, and a lot of that looks suspiciously like Perl code re-written in Ruby.
Read more...
Posted in ruby | Tags literateprogramming, peeves, perl, style | no comments | no trackbacks