Skip to content

Instantly share code, notes, and snippets.

@smooker
Created February 1, 2025 13:53
Show Gist options
  • Save smooker/1a9df1732833b74480e13e1980b814dc to your computer and use it in GitHub Desktop.
Save smooker/1a9df1732833b74480e13e1980b814dc to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use List::MoreUtils qw(uniq);
use Sort::Key::Natural qw( natsort );
use strict;
use warnings;
die "Usage: $0 [LINE LIST]\n" if @ARGV != 1;
my $input = $ARGV[0];
my @abv = natsort( uniq split(/ /, $input));
foreach my $word (@abv)
{
print($word);
if( $word eq $abv[-1] ) {
print "\n";
last;
}
print " ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment