#!/usr/bin/perl # start with this template .desc file if none present. $template = "~/scans/template-desc"; # bashism # Use this editor. Could use $ENV{'EDITOR'} I suppose, but # this is easier. $editor = 'nedit'; # build the .desc file name from the .jpg. $file = shift; $file =~ s/.[a-z]+$//; $file .= ".desc"; if ( ! -f $file ) { system "cp $template $file"; } system "$editor $file";