#!/usr/bin/perl use strict; my($from,$to,$fmt,$inc)=@ARGV; $to||=$from; $fmt||="%d"; print join("\n",map{sprintf("$fmt",$_)}($from>$to?reverse($to..$from):($from..$to))),"\n";