in reply to Perl file operators seem to behave strangely

It would be immensely easier to read this posting if you could put it within <code> tags.   (See: Markup in the Monastery.)