- Where Developers Learn, Share, & Build Careers


I am trying to explain why the chat function does not work for me to try to take input from the user Has been:

  My $ string = & lt; STDIN & gt; My $ chr = peak ($ ​​string); Print "string: $ string \ n"; Print "Four: $ chr \ n";   

output

  perl chop.pl Hello string: Hello four:   

But if I use a string I do it, so it works!

  My $ string = "frong"; My $ chr = peak ($ ​​string); Print "string: $ string \ n"; Print "Four: $ chr \ n";   

output [583]

  perl chop.pl string: fron char: g    

When you pass the input from the console, cutting chop to newline At the end is the string, which exists when you press Enter while your string does not have this.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -