#!/bin/sh
# -*- perl -*-
# This code allows us to start perl from our path or an environment variable
# rather than hardcoding a path into the #! line.  It works from sh or csh.
(exit $?0) && eval 'exec ${QPERLQ-perl} -x $0 ${1+"$@"}'
if (! $?QPERLQ) setenv QPERLQ perl
exec $QPERLQ -x $0 $argv:q

#!/usr/local/bin/perl -w
#
# $Id: kodak_pictures,v 1.1 1999/01/26 13:45:57 ejb Exp $
# $Source: /home/ejb/scripts/RCS/kodak_pictures,v $
# $Author: ejb $
#

require 5.002;
use strict;

my $whoami = ($0 =~ m,([^/\\]*)$,) ? $1 : $0;
#my $dirname = ($0 =~ m,(.*)[/\\][^/\\]+$,) ? $1 : ".";

&usage() unless @ARGV == 2;
my ($low, $high) = @ARGV;
&usage() unless (($low =~ m/^\d+$/) && ($high =~ m/^\d+$/));
my $i;
my @files = ();
for ($i = $low; $i <= $high; ++$i)
{
    my $file = sprintf("p%07d.jpg", $i);
    next unless -f $file;
    push(@files, $file);
}
print join(' ', @files), "\n";

sub usage()
{
    die "Usage: $whoami low high\n" .
	"  Prints picture names for Kodak DC220 digital camera within range\n";
}
