in reply to Problem with reading multi-line
Update: Condensed script. It should be:#!/usr/bin/perl use strict; use warnings; print "Enter the number of times : "; my $times= <STDIN>; my $prompt = q{Add values : }; my $maskPrompt = "\r" . ' ' x (length($prompt) + 2) . "\r"; my (@input) = (); print $prompt; chomp @input; print do { local $" = "\n -->"; " -->@input" }, "\n"; my $ascii; foreach $times(1 .. $times) { $ascii .= chr (<STDIN>); } print $ascii, "\n";
#!/usr/bin/perl use strict; use warnings; print "Enter the number of times : "; my $times= <STDIN>; my $prompt = "Add values : "; $prompt = "\r" . ' ' x (length($prompt) +2) . "\r"; print $prompt; my $ascii; foreach (1 .. $times) { $ascii .= chr (<STDIN>); } print $ascii, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with reading multi-line
by jwkrahn (Abbot) on May 03, 2010 at 02:16 UTC | |
by sarshads (Novice) on May 03, 2010 at 20:53 UTC | |
by bobf (Monsignor) on May 04, 2010 at 02:56 UTC | |
by sarshads (Novice) on May 04, 2010 at 18:42 UTC |