note
tangent
I didn't notice it was a string, thanks. So it could be done like this, though [toolic]'s answer is cleaner.
<code>
my $attached = $code ? { attach_path => $file_name, attach_filename => $file_name, attach_type => 'application/txt' } : {};
</code>
1165231
1165235