move from Perl to Ruby