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

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

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