in reply to What is the best way to find username running your script?

my $username = getpwuid($<);

Not sure how well it does on MSWin32.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'