Skip to content

Instantly share code, notes, and snippets.

@pdl
Created January 24, 2013 20:45
Show Gist options
  • Save pdl/4627534 to your computer and use it in GitHub Desktop.
Save pdl/4627534 to your computer and use it in GitHub Desktop.
A script which sorts itself
no less; use strict; use warnings;
open (my $fhIN, '<', $0) or die; my @lines = <$fhIN>;
open (my $fhOUT, '>', $0) or die;
print $fhOUT sort {$a cmp $b} @lines;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment