in reply to JAPH - short sort
$_="uccsm jhvkqldtr oee hofaxrtaajshkebuwelrnpitgnpry!"; #The join/sort statement turns the string into this: # ajbucsdte fagnhoitjhkelrm npoeprqlr shtaucvkwexry! #This is becuase the list passed to sort is what is #returned by the /(..)/g match; i.e., groups of two #The print statement joins every other character, via the #/.(.)/g statement with a newline($/); that prints out #the desired output, i.e., just anotherp perl hacker(\n separated) $_= join$\,sort/(..)/g and print ucfirst join$/,/.(.)/g;
|
|---|