Improved sample Perl snippets