Camelia
Prev: sed

sort

 Perl has an internal sort function that can even sort on arbitrary criteria.
 
 "input.txt".slurp.sort.say                       will sort the rows of the line according to the ASCII table
 "input.txt".slurp.sort:{ $^a <=> $^b }.say       will sort the rows 
 
 
 

Prev: sed

Table of Contents

Comments

In the comments, please wrap your code snippets within <pre> </pre> tags and use spaces for indentation.
comments powered by Disqus

Perl 6 Tricks and Treats newsletter

Register to the free newsletter now, and get updates and news.
Email:
Name: