in reply to Re: email subject issue in mailx
in thread email subject issue in mailx

Thanks for ur quick response... I tried ur code and faced the error: Can't use an undefined value as filehandle reference at 1.pl line 4. The code I used is:

#!/tools/sde/frame.sde/bin/perl $subject="I am subject"; $hfile="/aim2/actiview/web/scripts/samweb/perl-lib/mbm/mbm_csv/test1/t +2.csv"; open(my $fr_uuencode, '-|', uuencode => ( $hfile ) ) or die $!; open(my $to_mailx, '|-', mailx => ( -s => '$subject', -m => 'manjunath.bm\@alcatel-lucent.com mbm\@alcatel-lucent.co +m', ) ) or die $!; print $to_mailx $_ while <$fr_uuencode>;

Replies are listed 'Best First'.
Re^3: email subject issue in mailx
by almut (Canon) on Jan 12, 2010 at 19:04 UTC
    -s => '$subject',

    Don't know about your "undefined value as filehandle reference" error (Update: actually I do: you seem to have an ancient Perl (pre 5.6.1)), but you likely don't want single quotes around $subject.

Re^3: email subject issue in mailx
by ikegami (Patriarch) on Jan 12, 2010 at 19:40 UTC
    In addition to issues identified by almut,
    'manjunath.bm\@alcatel-lucent.com mbm\@alcatel-lucent.com'
    produces the string
    manjunath.bm\@alcatel-lucent.com mbm\@alcatel-lucent.com
    You want
    'manjunath.bm@alcatel-lucent.com mbm@alcatel-lucent.com'
    or
    "manjunath.bm\@alcatel-lucent.com mbm\@alcatel-lucent.com"