perl - Why does my output go to next line when there is no next line character in the script -


i learning & writing basic perl script follows:-

print "please enter name dear: "; $name = <stdin>; print "${name} learning perl"; 

for reason, output displayed as:-

please enter name dear: saas saas  learning perl 

why text after input name go next line character when there isn't \n mentioned anywhere?

print "please enter name dear: "; $name = <stdin>; chomp $name; print "${name} learning perl"; 

notice line 3. when send "saas" must press enter send it. newline appended name variable. chomp remove you


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -