The '<' is something that the shell interprets, but in the multi-arg form of system the shell is bypassed altogether, and '<' is being passed as another argument to mail. Try this instead:
my $address = 'myname@whatever.com'; my $subject = "Comments -- Version: $Version ID: $ID"; system("mail $address -s '$subject' < blah6.txt") == 0 or die "mail failed: $?";
Update: As ikegami's reply below alludes to, a major reason for using the multi-arg form of system is precisely to bypass the shell, and therefore avoid shell quoting headaches. The single argument form of system may not be suitable if $Version or $ID contain problematic characters. If this is the case, I would break down and read in the contents of the input file, and pipe it into the mail command from within the Perl code.
the lowliest monk
In reply to Re: System Command Issues
by tlm
in thread System Command Issues
by blanket
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |