Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Monks, the code works fine. When i get the input from the user for $text, i want to get the input with multiple lines. If the user gives enter after typing first line, the code starts running, i want to get the input even if the user gives enter key until he gives ctrl+c or ctrl+D or ctrl+z or some other option. How can i achieve this. Because in text part i want to print multiple lines. I tried by making input record separator undef, but it is not working as per my requirement
use Mail::Sender::Easy qw(email); print "Enter the From address with comma separator\n"; chomp ($from = <STDIN>); print "Enter the To address with comma separator\n"; chomp ($to = <STDIN>); print "Enter the cc address with comma separator\n"; chomp ($cc = <STDIN>); print "Enter the bcc address with comma separator\n"; chomp ($bcc = <STDIN>); print "Enter the subject\n"; chomp ($sub = <STDIN>); print "Enter the body part\n"; chomp ($text = <STDIN>); email({ 'from' => "$from", 'to' => "$to", 'cc' => "$cc", 'bcc' => "$bcc", 'subject' => "$sub", 'priority' => 2, # 1-5 high to low 'confirm' => 'delivery, reading', 'smtp' => '192.168.1.5', 'port' => 25, #'auth' => 'LOGIN', #'authid' => 'foo@bar.baz', 'authpwd' => 'protect_with_700_perms_or_get_it_from_input +', '_text' => "$text" }) or die "email() failed: $@";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: <STDIN> input
by xdg (Monsignor) on Apr 01, 2006 at 11:51 UTC | |
|
Re: <STDIN> input
by graff (Chancellor) on Apr 02, 2006 at 04:40 UTC |