#!/usr/bin/perl use strict; use warnings; no warnings 'uninitialized'; use File::Basename; my $imgsize = "800x600"; my $evolution_cmd = "/usr/bin/evolution mailto:"; my $first = 1; my $found = 0; foreach my $infile (@ARGV) { next if !-e $infile; $found = 1; my $outfile = basename($infile); my $image_type; ( $outfile, $image_type ) = $outfile =~ /^(.+)\.(.+?)$/; $outfile = "/tmp/${outfile}_verkleinert.$image_type"; qx { /usr/bin/convert -antialias -scale $imgsize "$infile" "$outfile" }; if ($first) { $evolution_cmd .= "?"; $first--; } else { $evolution_cmd .= "\\&"; } $evolution_cmd .= qq{attach="$outfile"}; } exit(0) if !$found; qx { $evolution_cmd };