3 ms·
Would you mind sharing this script with HN'ers?
by mattwdelong 17y ago
Would you mind sharing this script with HN'ers?
- earnubs 17y ago#!/usr/bin/perl -w use strict; # from selected block in vim: !scriptname.pl while (defined(my $line = <STDIN>)) { $line =~ m/^(.*)\{(.*)\}/; my $element = $1; my @list = split /;/, $2; @list = join ';', sort { $a cmp $b } @list; print STDOUT "$element" . "{@list}\n"; }