#!/usr/bin/perl BEGIN { *CORE::GLOBAL::getppid = sub () { return "Hello world!\n" . CORE::getppid(); } } print getppid(); #### *CORE::GLOBAL::getppid = sub () { return "Hello world!\n" . CORE::getppid(); }; 1; #### $ perl -Mmygetppid -e "print getppid()" Hello world! 23726
## *CORE::GLOBAL::getppid = sub () { return "Hello world!\n" . CORE::getppid(); }; 1; ##
## $ perl -Mmygetppid -e "print getppid()" Hello world! 23726