on do_stuff_with(an_item) do shell script "perl -e " & (quoted form of " use strict; use warnings; use Getopt::Long; # get Template from the command line my $TEMPLATE; GetOptions("template=%s",\$TEMPLATE); # and now process while (<>) { # do something with the line and the # TEMPLATE } ") & " " & (quoted form of "--template=" & some_user_changeable_config_stuff) & " " & (quoted form of POSIX path of an_item) end do_stuff_with