Completed p2 in Perl