Some exercise solution for Perl beginners