http://qs321.pair.com?node_id=1165237


in reply to Re^2: Odd number of elements in anonymous hash
in thread Odd number of elements in anonymous hash

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

Replies are listed 'Best First'.
Re^4: Odd number of elements in anonymous hash
by Anonymous Monk on Jun 09, 2016 at 17:23 UTC
    Thanks for all the help, I like tangent's answer!