Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: Read text file - Encoding problem?

by better (Acolyte)
on Mar 17, 2013 at 11:32 UTC ( #1023900=note: print w/replies, xml ) Need Help??

in reply to Re: Read text file - Encoding problem?
in thread Read text file - Encoding problem?

Hi Kenosis,

thanks again for your support.

Of course, you are right reminding me to use lexical variables for file handles. I changed that and added 'use strict;', this time without getting errors like "requires explicit package name".

The chomp command was intended to cut a newline, if there should be a field including one (it doesn't make a difference, so I deleted it).

I can't follow you, implementing the matching command here. If I understand it correctly, it compares the strings given in a row with a certain pattern? What I want to achieve is, to get the string (ID) of the first field of the first coloumn and use it as a regex for matching the fh of read_dir. Than get the second string of the first coloumn etc. (all IDs are listed in the first coloum only).

The problem why it is not working seems to be an unvisible thing at the end of each line. Following McAs hint to get the hex number of the text file: the result is that each line ends with the letter "d". This might cause the problem, because the script works with another text file, in which the lines don't end with "d".


  • Comment on Re^2: Read text file - Encoding problem?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023900]
[LanX]: unusual that "Pimp my Bride" never made it into TV (?)
LanX sighs ... no idea stupid enough
[choroba]: "Smack My Bitch Up" did, though
[Eily]: that's the internet for you LanX
[Eily]: and I'm pretty sure there's a rule somewhere that states that the stupider the idea, the more likely it is to already have been done
zentara is thinking of moving to Mars to esacpe it all
[LanX]: Zentara eq Dr Manhatten ?
[zentara]: more like Dr. Helion3 :-)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2017-03-27 15:21 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.