Added function to handle print statement in Perl.