in reply to removing space from beginning and end of sentence

Your question, (especially the "can't use the chop function" bit) smells a lot like homework. Please make an attempt at solving your problem, then show us what you've tried and we'll point out why it's failing.

As a further clue, take a look at perldoc perlre and the docs for the s/// operator in perldoc perlop.


There are ten types of people: those that understand binary and those that don't.