Page 1 of 1

Little Perl script for sorting objects inside each subject

PostPosted: Sat Mar 04, 2006 8:56 pm
by Hue-Bond
This is something I cooked up in a couple of minutes for those like me that can't stand having the objects unsorted.

Code: Select all
# cat > sorter.pl
(m#^\s*/# .. m# ^[^\s] | ^\s+[^/] #x) =~ /^\d+$/ and push @s, $_ and next;
print sort @s and undef @s if @s;
print;
<type a ^D here>
# perl -n sorter.pl policy > policy2