in reply to File that exists won't open

I am also curious why you use chop instead of chomp, which, if memory serves (and untested by me in recent memory), is more flexible and better suited to this particular action.

Replies are listed 'Best First'.
Re^2: File that exists won't open
by jellisii2 (Hermit) on Mar 07, 2014 at 13:56 UTC
    What's not mentioned is that ALL last characters are problematic, not just line ending ones. The last letter of the file extension is always overly pesky.