$ perl -E '$x = "txt"; sub ref {return $x . "r";}; say &ref($x);' txtr $ perl -E '$x = "txt"; sub ref {return $x . "r";}; say ref($x);' $ #### $ perl -wE '$x = "txt"; sub ref {return $x . "r";}; say &ref($x);' txtr $ perl -wE '$x = "txt"; sub ref {return $x . "r";}; say ref($x);' Ambiguous call resolved as CORE::ref(), qualify as such or use & at -e line 1. $ #### $ perl -wE 'sub say {print "txt\n";}; &say("hello");' txt $ perl -wE 'sub say {print "txt\n";}; say("hello");' hello