Read Line question

I'm reading lines from a file. My only problem is I need to get rid of the carriage return at the end of each line that I am reading. I used chop $line to do so but if the last line of the file doesn't contain a carriage return it chops off a letter. Is there another way around this?

Thanks

Comments

  • : I'm reading lines from a file. My only problem is I need to get rid of the carriage return at the end of each line that I am reading. I used chop $line to do so but if the last line of the file doesn't contain a carriage return it chops off a letter. Is there another way around this?
    :
    : Thanks
    :

    It's ok, I'm now using chomp $line and now it works perfectly! :-)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion