Created
February 1, 2025 13:53
-
-
Save smooker/1a9df1732833b74480e13e1980b814dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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