sub commify { my $text = reverse $_[0]; $text =~ s/(\d{3})(?=\d)(?!\d*\.)/$1,/g; return scalar reverse $text; } #### if ($beta =~ /tar.gz\z/) { ...