- elsif ($args{'Content'}) {
- @lines = split('\n',$args{'Content'});
- }
- #get us a tempfile.
- my ($fh, $filename) = tempfile();
-
- #write to a tmpfile
- for (@lines) {
- print $fh $_;
- }
- close ($fh);
-
- #Edit the file if we need to
- if ($edit) {
-
- unless ($ENV{'EDITOR'}) {
- $RT::Logger->crit('No $EDITOR variable defined'. "\n");
- return undef;
- }
- system ($ENV{'EDITOR'}, $filename);
- }
-
- open (READ, "<$filename");
- my @newlines = (<READ>);
- close (READ);
-
- unlink ($filename) unless (debug());
- return(\@newlines);
-
-}