How to write shell scripts in Perl