in reply to Length and Chomp ??
The Return key press would be treated as part of the input and you have to trim it using chomp before going further. chomp after the 7th line worked just fine for me!!!
use strict; use warnings; print "Enter the string ="; my $str = <STDIN>; chomp $str; print "Enter the size ="; my $n = <STDIN>; chomp $n;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Length and Chomp ??
by afoken (Chancellor) on Aug 22, 2009 at 16:11 UTC | |
by biohisham (Priest) on Aug 22, 2009 at 18:53 UTC | |
by afoken (Chancellor) on Aug 23, 2009 at 19:22 UTC |