# define the task my $task = <<'_EOT_'; # use ' to prevent interpolation #!perl -T # use -T to specify taint mode use strict; use warnings; # (your processing goes here) # (generate and send notification - suggest using Mail::Sendmail) __DATA__ _EOT_ # append the data $task .= join "\n", @data; # save the task open my $tf, '>', $tmpfile; print $tf $task; close $tf; # submit the task system('batch', '-M', '-f', $tmpfile); # (tell user the task has been submitted) #### system("nohup $tmpfile &");