Added swap snippet for Perl