BEGIN { *CORE::GLOBAL::ucfirst = sub { join ' ', map "\u$_", split / /, @_ ? $_[0] : $_; } } $_ = "one two 'three' four\n"; print "\u$_"; print ucfirst; #### BEGIN { *CORE::GLOBAL::ucfirst = sub { join ' ', map ucfirst, split / /, @_ ? $_[0] : $_; } } $_ = "one two 'three' four\n"; print "\u$_"; print ucfirst;