Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Terms shortener :-)

by reisinge (Hermit)
on Jan 09, 2018 at 13:22 UTC ( [id://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 (Cardinal) 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
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://1206972]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-24 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found