#!/lang/perl
# ren is a rename function in perl somewhat like the debian rename function
# It takes a list of files, 1 per line, on STDIN,
# and outputs shell commands (mv -i foo bar) to rename them according to the
# perl program in $ARGV[0]
# e.g.: ren 's/^(\d+)(.jpe?g)$/sprintf("%03d",$1).$2/e'

eval q#
while (defined ($_=<STDIN>)) {
	chomp;
	$from = $_;
	#.$ARGV[0].q#;
	print "mv -i $from $_\n" if $from ne $_;
}
#
