($\={})=~s/(?<=.).+//&&print+(q/J/,\//=~ /..(\S)/&&$1.$2.($^X=~/.+\/(.)/&&uc($1)))
Thanks to ikegami (the "/" separator is not always the case with $^X):
($\={})=~s/(?<=.).+//&&print+(q/J/,\//=~ /..(\S)/&&$1.$2.($^X=~/\W(.)\w+\.?\w*?$/&&uc($1)))

Replies are listed 'Best First'.
Re: ref and JAPH
by ikegami (Patriarch) on Jan 09, 2009 at 19:01 UTC
    "JAH"? My $^X contains no "/". Keeping in spirit of using references, perhaps you should get your "P" from
    >perl -e"print ref qr//" Regexp
    ($\={})=~s/(?<=.).+//&&print+(q/J/,\//=~/.. (\S)/x&&$1.$2.((ref qr//)=~/.+(.)/&&uc($1)))