#!/usr/bin/perl -w # XXX CLI args for: # - prefix for each item # - postfix for each item # - line break between? # - step value use strict; use Getopt::Long; my $beg = 0; my $end; my $comma; my $sep; undef $sep; GetOptions('comma' => \$comma, 'separator=s' => \$sep); unless (defined($sep)) { if ($comma) { $sep = ','; } else { $sep = ' '; } } if ($ARGV[0] =~ m/[0-9]/) { $beg = $ARGV[0]; if ($ARGV[1] =~ m/[0-9]/) { $end = $ARGV[1]; } else { $end = $beg + 10; } } my $i; for ($i = $beg; $i < $end; $i++) { print "$i$sep"; } print "$i\n";