#!/usr/bin/perl -p

# isort -- sort C variable declarations separated by commas

s/([^,]*?)(\S+[,;])/$2/; $prefix = $1;
s/;$/,/; @words = sort split /\s+/;
$_ = $prefix . (join ' ', @words) . "\n";
s/,$/;/;