Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Terms shortener :-)

by reisinge (Friar)
on Jan 09, 2018 at 13:22 UTC ( #1206972=CUFP: print w/replies, xml ) Need Help??

echo 'authentication' | perl -F'' -lape '$_ = $F[0] . (@F-2) . $F[-1]'
Modified: added -a as advised by choroba
And like that ... he's gone. -- Verbal

Replies are listed 'Best First'.
Re: Terms shortener :-)
by choroba (Bishop) on Jan 09, 2018 at 13:29 UTC
    For pre-5.20 perls, one needs -alpe , as a ins't implied by F .

    I'd also try

    perl -pe 's/.\K(.*)(?=.)/length$1/e'
    (needs 5.10).

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

      Or even

      perl -pe 's/(?<=.)(.*)(?=.)/length$1/e'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://1206972]
Approved by marto
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-01-21 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (227 votes). Check out past polls.

    Notices?