Hello tty1x, and welcome to the Monastery!
The call to <STDIN> reads a line of text from the keyboard — it doesn’t complete until the user enters the return character, which is echoed to the screen. Then chomp removes the trailing newline from the string $name which has been initialised with the user-entered text. chomp has no effect on STDIN, only on the string variable $name.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Relationship between chomp() operator and STDIN
by Athanasius
in thread Relationship between Chomp() operator and STDIN
by tty1x
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |