in reply to Tie::file and html vs dos

Maybe I'm wrong, but I think that you are experiencing problems with the encoding of the end of line in your html file. Is your html file written in dos/Windows?, i.e has '\r\n' at the end of each line?. Are you processing it in *nix ('\n'). That would explain why you are seeing those ^M characters in vim. If that is true, Tie::File is seeing the whole file as just one line, and inserting your $line at the end of that unique line

You can see how many lines Tie::File is seeing with print $#testarray

Try one of the following (not both!):

Hope this helps

Citromatik

Replies are listed 'Best First'.
Re^2: Tie::file and html vs dos
by Flubb (Acolyte) on Feb 08, 2008 at 15:42 UTC
    Thanks guys, I'll have a go at them this weekend. The files are both processed in windows machines, but somehow the interpolation of perl functions is mucking about with that function. I had a look to see if Tie::file had anything to do with unix vs. dos formats but couldn't make any headway. Cheers ;)