in reply to Re: Not able to ParseDate lines from a file
in thread Not able to ParseDate lines from a file

The other answers should help you already with your problem, but if you are interested in the mystery of your $year number, read on.

If you want to specify control characters or some other non-printable character codes in perl you can use special codes. For example to put a newline into strings you could use \n or hexadecimal \x0a or octal \013. What you see in your Dumper output is a zero byte, \000 aka \x00, followed by \x32 which is (in ASCII or UTF-8) a "2" character followed by \x00 again.... It seems to be a 16-bit character format. Printing this will look like "2010" because \x00 doesn't have a character icon, but for perl it is not a string it can convert to numbers.

  • Comment on Re^2: Not able to ParseDate lines from a file