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
Post a Comment